We have an entry form that gives the user a calendar drop down, but also are allowed to type in a data manually. We discovered that if a person enters a 2-digit year, the year is changed to 1912 not 2012 (dates cannot be in the past). Is there a way I can:
- Check if they entered a 2-digit year and convert that to a 4-digit year, or
- Give them an error if they enter a 2-digit year.
This is on an HTML form and I also am using jQuery for a bunch of other stuff.
I should clarify that they enter the date as a whole date 01/01/2012 or 1/1/2012 is valid. 1/1/12 and 01/01/12 is not.
Simplest is a regexp as it will also invalidate non-numeric values;