I have an text input field in my form that requires a valid date input (for birthdate). How would I do a date validation of this field in Javascript?
Thanks for the example.<br><br>However, I do not believe it will solve my main problem. The example script accepts 15/35/1966 as a valid date. I need to be able to validate that the date entered is a proper date.
That's because the Date object adds the extra days and months to the time and comes up with April 4th 1967 as a valid time.<br><br>If you want to make sure the user knows how to enter a date correctly then you will have to parse and check the values using your own rules. This means you will have to account for leap year and the days of the month. That is why most sites use drop down boxes for selection of Month and Day etc., it is easier.<br><br>Good luck<br>-pete<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.