I a trying to use mootools to validate my form fields. They all work except #11 Validate-Selection.
My form element looks like this:
<label for="county">*County of Residence</label>
<select name="county" id="county" class="text" style="width:200px;">
<option value="x">Please select a county</option>
<optgroup label="New Mexico">
<option value="BERNALILLO">BERNALILLO</option>
<option value="CATRON">CATRON</option>
</optgroup>
<optgroup label="Other State">
<option value="ALABAMA">ALABAMA</option>
<option value="ARIZONA">ARIZONA</option>
</optgroup>
</select><br /><p>
I am trying to get the form to refuse the 'Please select a county' option, but putting in the field names of 'county' or 'x' doesn't work. I'm not sure what syntax to use to assign a field name to just 'Please select a county' option - what am I doing wrong?
thanks so much!
musenut
My form element looks like this:
<label for="county">*County of Residence</label>
<select name="county" id="county" class="text" style="width:200px;">
<option value="x">Please select a county</option>
<optgroup label="New Mexico">
<option value="BERNALILLO">BERNALILLO</option>
<option value="CATRON">CATRON</option>
</optgroup>
<optgroup label="Other State">
<option value="ALABAMA">ALABAMA</option>
<option value="ARIZONA">ARIZONA</option>
</optgroup>
</select><br /><p>
I am trying to get the form to refuse the 'Please select a county' option, but putting in the field names of 'county' or 'x' doesn't work. I'm not sure what syntax to use to assign a field name to just 'Please select a county' option - what am I doing wrong?
thanks so much!
musenut
Hi musenut,
You need to have an empty value
Bob
You need to have an empty value
<option value="">Please select a county</option>
Bob
This topic is locked and no more replies can be posted.