I think sleipnir214 is right. Do all possible validations at the browser side, especially using "onsubmit" event handler and javascript coding, and leave those validations against databases at the server side.
For more details see
I believe what sleipnir214 is talking about is breaking up the date into three input elements, day, month, year. When you submit the form there is no ambiguous format since you assemble the elements server side.
Validation is still necessary sinve they still could select Feb. 31 etc.
JavaScript is a good idea but you can't depend on it. It's best to never trust any cleint side submitted data. Always inspect and validate what is submitted.
Does your solution take into consideration:
1. user enters 2-29-2003 or 29.2.2003 etc.?
2. if Javasciprt does the checking, how does the PHP code validate?
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.