Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

formatting time field

Community Beginner ,
Apr 23, 2019 Apr 23, 2019

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

TOPICS
Acrobat SDK and JavaScript , Windows
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 23, 2019 Apr 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.

Translate
Community Expert ,
Apr 23, 2019 Apr 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 23, 2019 Apr 23, 2019

where i have to put this script ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 23, 2019 Apr 23, 2019

As the custom Keystroke script of your field...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 23, 2019 Apr 23, 2019

when i put the script and click ok

it back to first format window without saving the script

why ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 23, 2019 Apr 23, 2019

yes it disappear but i do not care as long it works

thank you so much as long you help me

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 23, 2019 Apr 23, 2019
LATEST

There's a technical reason behind it (or a bug, if you'd like), but the important thing is it should work none-the-less.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines