How to Automatically Fill Address Fields from a PDF Drop-Down List in Acrobat
Question details
The user wants to automatically populate an address text field in a PDF form based on the selection made in a combo box (drop-down list).

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form where selecting a specific client or name from a drop-down menu automatically inserts their corresponding address into a separate text field.
- Observed behavior
- The user needs the correct JavaScript method and event trigger to dynamically update one field based on the value of another.
Ensure your PDF document is open in a form-editing mode and that you have already created both the drop-down list (Combo Box) and the target text field for the address.
Use a Custom JavaScript Validation Script
Add a JavaScript code snippet to the drop-down field's validation event to automatically check the selected value and populate the address field.
By utilizing Acrobat's built-in JavaScript capabilities, you can execute a script every time the value of the drop-down list changes. The 'Validation' event is the most reliable place to put this script because it triggers immediately after a user makes a selection.
Enter form editing mode in your PDF editor. Right-click the drop-down list (combo box) you want to use as the trigger and select 'Properties'.
In the Properties dialog box, click on the 'Validate' tab to configure what happens when the field's value changes.
Select 'Run custom validation script' and click the 'Edit' button. Enter your conditional code, for example: if (event.value == "John") this.getField("Address").value = "Main Street 1";
Replace "John" with your actual drop-down item, "Address" with the exact name of your target text field, and "Main Street 1" with the corresponding address. Click 'OK' and close the Properties window.
Exit form editing mode and select a value from your drop-down list to verify that the target address field updates automatically.

Create and Manage Interactive PDF Forms with WPS Office
WPS Office offers a powerful PDF editor that makes it easy to design, edit, and fill out interactive PDF forms without complex setups.
- 1. Open the PDF File: Launch WPS Office and open the PDF document you wish to turn into an interactive form.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to view all available form control elements.
- 3. Insert Form Fields: Click on 'Combo Box' or 'Text Field' and click anywhere on the page to place the interactive elements.
- 4. Customize Properties: Double-click the inserted field to open the Properties panel, where you can rename fields and adjust formatting or action settings.

Frequently Asked Questions
Why isn't the address field populating when I change the drop-down selection?
This usually happens if the script is placed in the wrong event or if the field names in the script don't match exactly. Ensure the script is in the 'Validate' event of the drop-down field, and verify that the target field name perfectly matches what is inside this.getField().
Can I automatically fill multiple text fields from a single drop-down selection?
Yes. You can expand your JavaScript code to update several fields at once. For example, within your 'if' statement, you can add additional lines like this.getField("City").value = "New York"; to populate a city field simultaneously.
Will this JavaScript auto-fill work on mobile PDF viewer apps?
Compatibility on mobile devices varies significantly. Many mobile PDF readers have limited or no support for custom JavaScript validation events. For the best experience, users should fill out these complex interactive forms using a desktop PDF application.




