I'm trying to use required validation controls on two text boxes and tried using the following code:
but I can still enter whatever I want into the text box. What I'm trying to check for is that users are entering a time in a valid format.
Can someone please point out to me where my expression may be wrong?
Thank you
Doug
Code:
<asp:TextBox ID="starttimeInput" runat="server" Width="130px" Height="23px"></asp:TextBox>
<span class="style1">*</span> Start Time <asp:RequiredFieldValidator ValidationExpression="^([1-9]|1[0-2]|0[1-9]){1}(:[0-5][0-9][aApP][mM]){1}$"
ID="StartTimeValidator" runat="server"
ErrorMessage="You Must Supply Both a Start and an End Time"
ControlToValidate="starttimeInput"></asp:RequiredFieldValidator>
Can someone please point out to me where my expression may be wrong?
Thank you
Doug
Comment