Lead generation form - link change
I am trying to set up a simple experiment by removing a field from a lead generation form. While testing it, I experience an error.
- If I test the original version of the form, when submitting it I get to the success page http://www.ravissante.ro/pantofi-unicat.html?action=success#Pantofi unicat
- When I test the variation of the form, after submitting it I get to this page www.ravissante.ro/http://www.ravissante.ro/pantofi-unicat.html?action=success#Pantofi unicat, resulting in a 404 error.
Can you, please, help me figure out why is the addition to the URL happening?
The 404 error is caused by an stray "forwardslash" in your code.
Where your code has this:
remove the / - changing it to this:
Rather than removing a single field from the form (and updating some , your code is replacing the entire form. Unfortunately, one of the hidden fields in the form is a "form id" which is unique/different every time the form loads. Replacing the form with the same formid could cause it to not work correctly (I preusme the formid field is present in the form and is different for each user for a reason).
Here is modified code that does what you are looking for.
The first line of it removes the field you want removed, the icon that goes in that form field, and the white-space below that field so that everything lines up nicely:
$('.pantofi-unicat-input[name="mentions"], .mentions-icon, form[name="pantofi-unicat"] br.cl-both:eq(3)').remove(); $(".pantofi-unicat-form-title").html("Suntem aici sa-ti indeplinim visele"); $(".pantofi-unicat-form-info").html("Lasa-ne datele tale si te contactam pentru a stabili detaliile");
Analytics and Testing Guru