Skip to main content
Participant
June 25, 2025
Question

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

  • June 25, 2025
  • 1 reply
  • 148 views

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? 

1 reply

PDF Automation Station
Community Expert
Community Expert
June 25, 2025

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.