How Validate select list

pxforti 10 Aug, 2011
I have a select list and I want to require that a user make a selection.
eg.
<select size="1" name="howheard">
<option selected="selected" value="">choose one</option>
<option value="Referral">Referral</option>
<option value="Tradeshow">Tradeshow</option>
<option value="Direct Mailer">Direct Mailer</option>
<option value="Yellow Pages">Yellow Pages</option>
<option value="Search Engine">Search Engine</option>
<option value="Other">Other</option>
<option value="Magazine Ad">Magazine Ad</option>
</select>

In validation tab, I have howheard in the required field. But I can still submit form with selecting a value from the list.

I must be missing something.

Thanks
GreyHead 10 Aug, 2011
Hi pxforti,

I suspect the problem is the selected='selected' in the first option. Please remove the Selected entry and see if that clears the problem. If not please post a link to the form so I can take a quick look.

Bob
GreyHead 11 Aug, 2011
Hi pxforti,

Seems as though you also need to add value='' to that first option; otherwise the browser assumes that the value is 'choose option'.

Bob
pxforti 11 Aug, 2011
I added the empty value for first and still doesn't work.

I attached a screen show of validation screen
GreyHead 11 Aug, 2011
Hi pxforti,

In validate-selection you just want the name of the select tag, not a list of all the options.

Bob
pxforti 11 Aug, 2011
Thanks. It's working now. Enjoy the beer😉
This topic is locked and no more replies can be posted.