Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time validation - at onblur

Status
Not open for further replies.

keijen

Programmer
Jul 12, 2001
16
AU
We need a javascript military-time validation function.
We've looked at samples from many places but there is no generic function that just sits and allows us to offer 'invisible' useability.
The best date validator we've found, for function, useability and adaptability is Richard Gorreman's script at We're searching for a time checker that operates just like that excellent script.

That would provide a script that works like :
1. Field accepts time with or without separator, or accepts "." or ":" separator (e.g. hh.mm or hh:mm), converts and rewrites to screen as hh:mm ready for standard database format.
2. Only permit numeric chars to be entered, plus full edit set with working backspace etc.
3. Does not reuqire a submit before validation, works within the field tag - and keeps focus in same field if there's an invalid time entry, else allows focus to be moved.
4. Allows normal tab key to move to next field/control if valid entry made.

In fact, just like Richard's script, but for military time instead of dates.

TIA
keijen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top