Rich-text Reply

Removing a Required Form Field?

SlamMan 07-11-14
Accepted Solution

Removing a Required Form Field?

Is it possible to make a required filed optional or remove a required form field entirely with the optimizely editor?  I can hide or remove the fields but I'm unable to get it to actually work in practice since the page still requires content in that field when submitting.

 

I'm trying to test the telephone field in our checkout page.  My assumption is that it will help conversion by making it optional or removing it entirely but I'd love to see the numbers.  My experiment ID is 1478314146.

 

Any feedback is appreciated.

Level 2

bw 07-11-14
 

Re: Removing a Required Form Field?

[ Edited ]

Slamman,
It appears that your form validation is expecting a 10 digit value for this field before you can continue. Try adding an arbitrary value, then hide the field. Pasting the following line into your variation code should do the trick.

$("input[title=Telephone]").attr({"value":"1234567890"}).css({"display":"none","visibility":""});

bw
Optimizely
adzeds 07-14-14
 

Re: Removing a Required Form Field?

Yup. As the previous reply has stated you just need to populate it with something you know to be wrong.

 

If you make sure you make the value something that is easy to find in the database you can run a clean up once you have finished your testing.

 

 

David Shaw
Level 11
SlamMan 07-14-14
 

Re: Removing a Required Form Field?

Simple yet genius! I'll give it a shot.
Level 2
Amanda 07-14-14
 

Re: Removing a Required Form Field?

@SlamMan - Let us know if it does the trick for you! 

 

 

Optimizely
eventinc 07-22-14
 

Re: Removing a Required Form Field?

hey, this fix isn't working for manditory-dropdown fields. is there also a fix available? siem
Level 1
adzeds 07-22-14
 

Re: Removing a Required Form Field?

@eventinc - For this to work you would need to replace the dropdown with a hidden input and add a pre-set value for that field.

David Shaw
Level 11
eventinc 07-22-14
 

Re: Removing a Required Form Field?

ok thx that worked for me. Anoterh question regarding this problem: How is it possible to SET a manditory field via optimizely (which was not a manditory field before).

 

Siem

Level 1
adzeds 07-22-14
 

Re: Removing a Required Form Field?

@eventinc - That is a little more difficult. I guess it initially depends on how you do your current field validation.

You could simply add a piece of Jquery that checks for a form submit and intercept your current form validation with validation for the single field first.

I am not sure why you would want to 'add' validation to an existing form in a test but I am sure there is possibly someone here who can provide an efficient solution as it is not something I have tackled before.
David Shaw
Level 11