SOLVED

Re: form with a drop down field that is required

Go to solution
mrkcrne
Level 2

Re: form with a drop down field that is required

OK, so how would I go about putting a hint in a drop down or somehow saying that "Select" isn't a valid selection and make the user select something else?

SanfordWhiteman
Level 10 - Community Moderator

Re: form with a drop down field that is required

Why would you do that instead of having an empty server value, which is the default setup?

 

If the topmost option must not fulfill the Required-ments, then it should not have a server value.

Jo_Pitts1
Level 10 - Community Advisor

Re: form with a drop down field that is required

@mrkcrne ,

ultimately, if you have no value in the 'select' option, Marketo will display an error anyway when someone moves through the field, or tries to submit the form.

 

To make that work, you need to get rid of the value in the red box.  

Jo_Pitts1_0-1644280636550.png

 

If you placed your form (configured as you showed it in the screen shot of your drop down options) on a test landing page, this would happen natively, as you've got no entry for the stored value.

 

To prove this, I inspected the form elements and altered the select option for industry.

Jo_Pitts1_0-1644281077391.png

 

When I tried to submit the form I got this error

Jo_Pitts1_1-1644281098784.png

 

Talk to your dev team about WHY what they are doing is adding in the value="select" instead of leaving as value="", and could they please stop.

Cheers

Jo

 

SanfordWhiteman
Level 10 - Community Moderator

Re: form with a drop down field that is required

Exactly, there's no reason to have a non-empty value. That's needlessly breaking the form logic, which works out of the box.