I have a form that I am creating and i would like the user to only enter 4 digits to represent HHMM and validate to HH:MM I have found a script that does this but for a date, and I was wondering if there was someone who could help out? Thanks in advance..
You need to write a script that validates that the input is indeed 4 digits long, and that the first two are between "00" and "23" and the second two are between "00" and "59". That's pretty much it...
You could also use one field for each time entry and format as "Time" with a format of "hHH;MM" which is 24 hour format and it will apply a limit of 00 - 23 for the hours and 00-59 for the minutes.
This is a basic time sheet calculation. You can split the enterd value at the ":". Then multiply the hours by 60 and add to the minutes. This will provide the number of minutes since midnight. The difference in minutes between 2 fields will be the elapsed time which can be converted back to hours and minutes.