Rich-text Reply

Lead generation form - link change

LauraCtz 04-07-16

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. 


Can you, please, help me figure out why is the addition to the URL happening?




Level 1

JasonDahlin 04-08-16

Re: Lead generation form - link change

@LauraCtz -

The 404 error is caused by an stray "forwardslash" in your code.

Where your code has this:


remove the / - changing it to this:



Separately though.... 

 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"]').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");


--Jason Dahlin
Analytics and Testing Guru Smiley Happy

Experimentation Hero