|
-
Jan 20th, 2004, 05:24 PM
#1
Thread Starter
Junior Member
Date Validiator
I have a textbox which requires to fill out date in the format mm/dd/yyyy
I want to know how i custom my validiator to check if input is in right
format
Thanks
-
Jan 20th, 2004, 07:25 PM
#2
PowerPoster
Use a regular expression validator.
Put this expression in the validation expression property:
Code:
([1-9]|(0[1-9])|(1[0-2]))\/([1-9]|(0[1-9])|([1-2][0-9])|3[0-1])\/[0-9]{4}
That might not be exactly what you need, but it will get you started. In case you were wondering, it uses regular expression to match up the value entered to verify it is a correct date.
I would still do a check on the server by trying to parse the text into a date object, and if it throws an exception, then kick that back to the user to reenter.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|