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

Can't get custom format category to stay selected in Acrobat

New Here ,
Jun 24, 2025 Jun 24, 2025

I'm trying to make my date text boxes to autotab and limit to one character.

To do this, I've added a javascript:

function tab_next(next_field_name) {

  if (event.willCommit || AFMergeChange(event).length === event.target.charLimit) {

    getField(next_field_name).setFocus();

  }

}

 

Then I would go to the text field I wanted to edit and go to Properties > Format, I would select custom under the format category. I would then add this script to the Custom Keystroke panel:

tab_next("NextFieldName");
Note that the NextFieldName is replaced with the date field box I needed

 

The problem happens when I click on OK and my script is not saved over and the format category changed back to None. How can I solve this? 

TOPICS
JavaScript , PDF forms
110
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 ,
Jun 25, 2025 Jun 25, 2025
LATEST

Are you selecting the field properties directly from the field, or from the field panel?  There has been a reported glitch that prevents scripts from sticking when the properties are accessed from the fields panel instead of the field directly.  If that is not the issue, or it doesn't work, make sure you have these settings under Edit > Preferences (Ctrl + k):

  • JavaScript category:  Enable Acrobat JavaScript is checked.
  • Security (Enhanced):  Enable protected mode at start up is NOT checked.
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