Regular expression for validating date format mmddyyyy in asp net
Also, if you restrict the keypresses to certain keys only, you can still bypass it by clicking in that text box and pasting text from somewhere else.
I want date in a dd/mm/yyyy format with validation in Text Box . As I got date with dd/mm/yyyy but it will also accept 32/02/2005. Also when I compare two textbox it will not evalute properly. So I had used Compare Validator, & select type="date" but it will not evalute. Thanking You, One thing that must be kept in mind when using Asp.
Is Valid value that tells the page if validators returned true or false and then proceed further.
:1[6-9]|[2-9]\d)\d))$)$ You could use a Custom Validator and have the client-side validation be simple and on the server-side use a Date Time. Although I suspect you don't need your code to work all the way to the year 9999 (no, I couldn't immediately see if the supplied regexes work that far into the future).
aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.