|
-
October 20th, 2008, 02:17 AM
#1
problem in validation control
i use a validation control for displaying data in correct format.If the user enters date in a text box he must enter it in mm/dd/yyyy format but if he enters wrongly it must dispaly an error message which i want to do it using validation control
and i have written the code for it in the following format:
<asp:regularexpressionvalidator id="regExpDate" runat="server" Display="Dynamic" EnableClientScript="False" ControlToValidate="txtSelect"
ErrorMessage="It is not a valid date.Format is MMDDYY" ValidationExpression="^\d{2}[\/-]\d{2}[\/-]\d{2,4}$"></asp:regularexpressionvalidator></TD>
but its not working
can anyone sort it out
-
October 20th, 2008, 07:50 AM
#2
Re: problem in validation control
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
October 20th, 2008, 09:42 AM
#3
Re: problem in validation control
First, if you're requiring a 4 digit year, make the last part \d{4}, otherwise it will accept a 2, 3, or 4 digit year.
Otherwise, what values are you testing with?
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
|