Use an Acrobat Script to Make a PDF Combo Box Editable
Question details
The user needs to enable custom text input for multiple combo box fields in a PDF form created from InDesign without opening each property dialog manually.

- Product
- Adobe Acrobat PDF Forms
- Device & OS
- not provided
- Scenario
- Modifying form fields so that end-users can type custom text into combo boxes, particularly when dealing with many fields where manual adjustments would be too time-consuming.
- Observed behavior
- By default, the combo boxes do not allow custom text, and manually opening the properties for each field to check the editable option is highly inefficient.
Ensure you know the exact field names of the combo boxes you wish to modify, and always save a backup copy of your PDF document before executing any JavaScript.
Use Acrobat JavaScript to Set the Editable Property
Run a simple JavaScript command within Acrobat to programmatically change the combo box properties without navigating through multiple dialog menus.
Instead of using the Action Wizard to open individual properties dialogs, you can utilize Acrobat's built-in JavaScript console to instantly set the combo box to editable. This method is highly efficient for targeted form field updates.
In Adobe Acrobat, press Ctrl+J (Windows) or Cmd+J (Mac) to open the JavaScript Debugger console.
In the console window, type the following code: var f = this.getField("myComboBox"); f.editable = true; replacing "myComboBox" with the actual name of your field.
Place your cursor on the line of code and press Ctrl+Enter (or Cmd+Enter on Mac) to run the script. The combo box will immediately allow custom text.

Manually Enable Custom Text via Field Properties
If you only have a small number of fields, adjusting the properties manually may be quicker than looking up field names for a script.
Manage PDF Forms Easily with WPS Office
Skip the complex JavaScript coding. WPS Office includes a powerful and intuitive PDF editor that allows you to manage, create, and configure form fields effortlessly.
- 1. Open your PDF Form: Launch WPS Office and open your interactive PDF document.
- 2. Access the Form tools: Navigate to the 'Form' tab on the top menu ribbon to access all interactive field tools.
- 3. Modify the Combo Box: Double-click on the combo box you wish to edit to instantly open its property settings.
- 4. Toggle custom input: Check the necessary configuration options to allow user text input, then save your document.

Frequently Asked Questions
Can I use Action Wizard to apply this JavaScript to multiple PDF files at once?
Yes. You can create a new Custom Action in the Acrobat Action Wizard, add the 'Execute JavaScript' tool, and paste your code. This allows you to run the script automatically across a batch of selected PDF files.
Why is my JavaScript returning an error or not making the combo box editable?
This usually happens if the field name in the getField("...") command does not exactly match the name of the form field. Field names are case-sensitive. Ensure the PDF isn't secured with permissions that prevent script execution.
Is it possible to loop through all combo boxes in the PDF and make them editable?
Yes. You can write a JavaScript loop using this.numFields and this.getNthFieldName(i) to iterate through all fields in the document, check if their type is 'combobox', and then set their editable property to true.




