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

formatting time field

Community Beginner ,
Apr 23, 2019 Apr 23, 2019

Copy link to clipboard

Copied

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

Views

876

Translate

Translate

Report

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.

Votes

Translate

Translate
Community Expert ,
Apr 23, 2019 Apr 23, 2019

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

where i have to put this script ?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

As the custom Keystroke script of your field...

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

when i put the script and click ok

it back to first format window without saving the script

why ?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

thank you so much as long you help me

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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