I am trying to validate the input of a military time. However, it always rejects whatever I enter for the time in the RadDateInput field, but the validation works just fine in a textbox. My test code looks like:
Can someone please tell me what I am doing wrong?
Many thanks!
Time:
<
telerik:RadDateInput
ID
=
"RadDateInput1"
runat
=
"server"
DateFormat
=
"HH:mm"
Width
=
"50"
/>
<
asp:RegularExpressionValidator
ID
=
"RegularExpressionValidator1"
runat
=
"server"
ErrorMessage
=
"Invalid Time"
ControlToValidate
=
"RadDateInput1"
Display
=
"Dynamic"
ValidationExpression
=
"(([01][0-9])|(2[0-3])):[0-5][0-9]"
SetFocusOnError
=
"true"
/>
<
br
/>
Time2:
<
asp:TextBox
ID
=
"txtTime"
runat
=
"server"
Width
=
"50"
/>
<
asp:RegularExpressionValidator
ID
=
"RegularExpressionValidator2"
runat
=
"server"
ErrorMessage
=
"Invalid Time2"
ControlToValidate
=
"txtTime"
Display
=
"Dynamic"
ValidationExpression
=
"(([01][0-9])|(2[0-3])):[0-5][0-9]"
SetFocusOnError
=
"true"
/>
<
br
/>
<
asp:Button
ID
=
"btnSubmit"
runat
=
"server"
CausesValidation
=
"true"
Text
=
"Submit"
/>
Can someone please tell me what I am doing wrong?
Many thanks!