Hi All,
I have Required field validator in my ASP.NET application form. This Required Field validator is used to validate the time entered in textbox of my web page. Below given is the requirement for this textbox.
Invalid entry : 12:30 (this is without am/pm)
Valid entry : 12:30pm
i.e. i need to validate the user enters AM/PM for the TIME details(HH:MM) he entered in the Textbox.
Below given is the Regular expression that I am using for this.
"^([1-9]|1[0-2]|0[1-9]){1}(:[0-5][0-9][aApP][mM]){1}$"
But this regular expression work well when the user enters "12:30pm", but throws error when the user enters "12:30 pm".
i.e. as pe the above regular expression there shouldn't be any space between the HH:MM and AM/PM. I want to make sure that i am able to enter time with space also.
valid entry : "12:30pm" and "12:30 pm".
Please help me.
Regards
Jas ...
Go to the complete details ...