I tried searching for the solution in existing stackoverflow answers but I was not finding a suitable answer.
I have 3 fields:
- Year -
<input ...>
- Month -
<select>
- Day -
<input ...>
My question is involving leap years. If the user selects February I need to restrict the day input based on whether or not the provided year is a leap year.
Example
- Given 2012 / February - Valid input would be 1 through 29 for days
- Given 2013 / Februrary - Valid input would be 1 through 28 for days
Unfortunately I have to support this in all modern browsers as well as IE7 and IE8.