Time Field
- June 21, 2022
- 2 replies
- 4391 views
Hi there!
Thanks to a bit of research from previous discussions, I have been able to get a time field working the way I was hoping for. I basically want to add a time field that accepts this 00:00 format. To do this, on the field I added a Custom Keystroke Script (thanks @try67 for this):
if (event.change && AFMergeChange(event).length==2) event.change+=":";
This works great, as it automatically adds the ":" as soon as I enter the first two characters.
The only thing I am trying to do now is set the field so that it only accepts numbers and the ":", but no letters. I haven't been able to solve this, and am hoping someone may be able to help me only allow numbers and ":" to be accepted in this field.
Any help is greatly appreciated. Thanks so much in advance.
