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
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