I have a form with 3 dropdown boxes to select Month/Day/Year. I need to submit the info selected in ISO 8601 format (e.g. ‘2012-05-30’) via a hidden field. How can I use jQuery to build the date value based on what’s selected in those dropdown boxes?
The HTML is something like:
<select name=month>
<option>01</option>
<option>02</option>
<option>etc...</option>
</select>
<select name=day>
<option>01</option>
<option>02</option>
<option>etc...</option>
</select>
<select name=year>
<option>2012</option>
<option>2013</option>
<option>etc...</option>
</select>
<input type="hidden" name="date" value="">
1 Answer