Tuesday, June 4, 2024
 Popular · Latest · Hot · Upcoming
118
rated 0 times [  123] [ 5]  / answers: 1 / hits: 31767  / 12 Years ago, wed, january 16, 2013, 12:00:00

Possible Duplicate:

Can I apply the required attribute to <select> fields in HTML5?






I'm using the html5 contact form from here but I'm having issues trying to make the <select> field required. Everything else works fine, just having trouble with this and the dev hasnt responded when I asked about the field. this is what I have



 <select name=package id=package title=Please choose a package class=required>
<option value=>------------------</option>
<option value=basic>Basic</option>
<option value=plus>Plus</option>
<option value=premium>Premium</option>
</select>


What am I missing to get this working correctly?


More From » jquery

 Answers
14

I believe that the top answer to this question is what you're looking for.
To quote,




This works for me - Have the first value empty - required works on empty values.



<select required>
<option value=>Please select</option>
<option value=one>One</option>
</select>



[#80836] Tuesday, January 15, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aiyanakatelinp

Total Points: 578
Total Questions: 110
Total Answers: 111

Location: New Caledonia
Member since Thu, Mar 23, 2023
1 Year ago
;