View Full Version : Time Validation Help

12-04-2006, 08:51 PM
I have 2 fields; start time and end time. Is there a way to validate that they enter the times in the correct format? Ex. 12:00

Here is the basic code:
Start Time: <input type="text" name="startTime"> (HH:MM format)
End Time: <input type="text" name="endTime"> (HH:MM format)

I found the link below which is kind of what I'm looking for, but it has alot of extra stuff that I don't need. I just want to validate the hour and minute.

12-04-2006, 09:00 PM
I want, I want, I want....

12-04-2006, 09:46 PM
var rx= /^([1-9]|(11)|(12)) *\: *[0-5][0-9] *$/;

12-04-2006, 10:27 PM
thanks mrhoo I will see if I can make that work. You want what Ancora?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum