Skip to main content
Known Participant
April 23, 2019
Answered

formatting time field

  • April 23, 2019
  • 1 reply
  • 1751 views

hello

i want to use a custom keystroke script or code to make this function:

the ( : ) will insert automatically after i enter the first 2 digits

how to do that by javascipt

thanks

This topic has been closed for replies.
Correct answer try67

You can use this code to achieve it:

if (event.change && AFMergeChange(event).length==2) event.change+=":";

It's possible the code will disappear once you enter it. That's fine. It should still work.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 23, 2019

You can use this code to achieve it:

if (event.change && AFMergeChange(event).length==2) event.change+=":";

It's possible the code will disappear once you enter it. That's fine. It should still work.

Known Participant
April 23, 2019

where i have to put this script ?

try67
Community Expert
Community Expert
April 23, 2019

As the custom Keystroke script of your field...