How to Populate Multiple Acrobat Form Fields from a Combo Box
Question details
The user needs to automatically fill multiple target form fields (like serial number and battery type) when a specific equipment name is selected from a combo box in a PDF.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form for equipment tracking that auto-fills related data to save time.
- Observed behavior
- Requires a JavaScript implementation to map approximately 10 combo box selections to their corresponding target text fields.
Before writing your script, decide whether the auto-populated fields (like the serial numbers) should remain editable by the user or be set to read-only.
Use Acrobat JavaScript in the Combo Box Properties
You can achieve this by adding a custom JavaScript to the Validate or Keystroke action of the combo box, which maps each selection to the corresponding field values.
By utilizing Acrobat JavaScript, you can listen for changes in the combo box selection. Once a user picks an equipment name, the script looks up the associated serial number and battery type, then updates the target text fields automatically.
Open your PDF in Adobe Acrobat, navigate to the 'Tools' menu, and select 'Prepare Form' to make your form fields editable.
Right-click the combo box, select 'Properties', and go to the 'Options' tab. Check the box for 'Commit selected value immediately' so the script triggers as soon as a selection is made.
Switch to the 'Format' tab, choose 'Custom' from the Select format category drop-down, and click 'Edit' next to Custom Keystroke Script. Alternatively, use the 'Validate' tab to run a custom validation script.
Enter a script using a switch statement or an object map. For example, use `if (event.value == 'Equipment A') { this.getField('SerialNumber').value = '12345'; }` to map the values. Ensure the field names in the script exactly match your PDF.
If the populated fields should not be manually altered, right-click the target text fields, select 'Properties', go to the 'General' tab, and check the 'Read Only' option.

Manage and Fill Interactive PDF Forms with WPS Office
While advanced custom scripting requires specialized software like Adobe Acrobat, WPS Office provides a lightweight, highly compatible alternative for viewing, filling, and managing standard PDF forms and Microsoft Office documents.
- 1. Download and Install: Download WPS Office for free from the official website and install it on your device.
- 2. Open Your PDF Form: Launch WPS Office and open your interactive PDF document using the built-in WPS PDF tool.
- 3. Fill and Save: Click directly on the highlighted form fields to input your data, then easily save or export your filled PDF.

Frequently Asked Questions
Why aren't my target fields updating when I select an item from the combo box?
This usually happens if the combo box is not set to 'Commit selected value immediately' in the Options tab of its properties. Without this checked, the script won't run until you click completely outside of the field.
Can I use Java to script my PDF form fields?
No. Despite the similar names, Java and JavaScript are different languages. PDF applications utilize a specific implementation called Acrobat JavaScript to automate form fields.
How do I make sure users cannot edit the fields that were automatically populated?
You need to change the properties of the target text fields. Right-click the field, select Properties, navigate to the General tab, and check the 'Read Only' box.
Do field names in the script need to be case-sensitive?
Yes, Acrobat JavaScript is strictly case-sensitive. The field names referenced in your `this.getField('FieldName')` method must match the exact capitalization used in the form field properties.




