Saturday, April 11, 2009

Restricting Date Values with Regular Expression validator

The code sample contains examples on how to restrict the user to enter a data value in a particular format. These formatting rules can be enforced by using Regular Expression validator.


date Format (for MM/DD/YYYY format)


([1-9]|1[012])[- /.]([1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d


date Format (for DD/MM/YYYY format)


(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home