Wordpress and multi step web forms

Hi All,

We’ve just started experiencing issues with our Wordpress website that we’ve embedded multi step web forms.

The “stage 2” forms are using hidden fields for things such as first name and email to ensure the 2nd stage matches the existing contact record and ties the answers on that form to the existing contact record,

It seems like the site developers have created a javascript to identify the necessary information from the thank you page.

Testing the web form shows the information showing in the URL, and the emailed notfication shows it in the URL, however it is not matching up with the hidden fields.

Is anyone else having this problem and come up a with a solution?

Here is the javascript code in case it helps debug it.

<script type="text/javascript">
function getParameterByName(name, url) {
    if (!url) url = window.location.href;
    name = name.replace(/[\[\]]/g, '\\$&');
    var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
        results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, ' '));
}

$inf_field_Email = getParameterByName('inf_field_Email');
$inf_field_FirstName = getParameterByName('inf_field_FirstName');


function setFields($inf_field_Email,$inf_field_FirstName {
  document.getElementById("inf_field_Email").setAttribute('value', $inf_field_Email);
  document.getElementById("inf_field_FirstName").setAttribute('value', $inf_field_FirstName);
}
window.onload = setFields($inf_field_Email,$inf_field_FirstName);
</script>

This issue has been solved it was to do with the HTML form code on the wordpress side needing a modification.

1 Like