I am trying to validate a text field for valid date (MM/DD/YYYY) I have not done this
validation before and wondering if it is easy to achieve through regular expression validator or through Jquery?
Example would be greatly appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest way in ASP.Net to validate an input text box to insure that is has a valid date is to use an ASP.Net CompareValidator. Set the Operator to “DateTypeCheck” and the Type to “Date”, and the form submission will only go thru if the input text box contains a valid date.
See here for more details:
http://msdn.microsoft.com/en-us/library/ad548tzy(v=vs.71).aspx
To insure that the date is in the past, use a ASP.Net Range validator, and programmatically set the MaximumValue and MinimumValue attributes to the max and min date your want: