Answered
Keystroke script for time in HHMM
Hi. I have a custom keystroke scipt to limit the text input field to numbers only.
if(!event.willCommit)
event.rc = !isNaN(event.change) || (event.change == "-" && event.selStart == 0);
else
event.rc = !isNaN(event.value);I would also like to limit the input to 4 characters and restrict the first 2 digits to a number between 00 and 23 and the second 2 digits to a number between 00 and 59.
Is there a way to split the 4 digit number into 2, to limit the input to achieve a time field with the format HHMM?
var t1 = Number(start.substr(0,2));
var t2 = Number(start.substr(2,2));
