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
Re: problem in validation control
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?