PDF Editing Issues

Populate PDF Form Fields from a Dropdown in Adobe Acrobat

Emma BrownEmma Brown Nov 19, 2026 868 views

Question details

Automatically populate location details in separate PDF form fields when a user selects a location from a dropdown.

Populate PDF Form Fields from a Dropdown in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form has a dropdown of locations and separate fields for the location name, address, telephone number, and fax number.
Observed behavior
Selecting a location should fill the corresponding fields with its details, while an unrecognized selection should clear them.
Before you start

Open the PDF in an Acrobat edition that can edit form fields, and note the exact names of the dropdown and destination fields. Check each dropdown option's export value, if one is set, because the script must match the value Acrobat submits.

Solution 1Recommended

Add a validation script to the Acrobat dropdown

Use a dropdown validation script to fill the related fields as soon as a location is selected.

1
Open the form editor

Open the PDF in Adobe Acrobat, choose All tools > Prepare a form, and open the dropdown field's Properties.

2
Commit selections immediately

In the dropdown Properties window, select the Options tab and enable Commit selected value immediately.

3
Add the validation script

On the Validate tab, select Run custom validation script and click Edit. Paste the following script, then replace the example field names, dropdown values, and location details with your own: var f1 = this.getField("Location Name"); var f2 = this.getField("Address"); var f3 = this.getField("Telephone"); var f4 = this.getField("Fax"); switch (event.value) { case "Location1": f1.value = "Location1 Name"; f2.value = "Location1 Address"; f3.value = "Location1 Telephone"; f4.value = "Location1 Fax"; break; case "Location2": f1.value = "Location2 Name"; f2.value = "Location2 Address"; f3.value = "Location2 Telephone"; f4.value = "Location2 Fax"; break; default: f1.value = ""; f2.value = ""; f3.value = ""; f4.value = ""; }

4
Save and test the form

Close the Properties window, save the PDF, and use Preview in Prepare a form to select each location. Check that all four fields update and that an unmatched or blank choice clears them.

Add a validation script to the Acrobat dropdown
Match field and dropdown values: Field names in getField must match the form's field names exactly. Add a case for each location and use the option's export value when one is defined. The script requires a PDF viewer that supports Acrobat form JavaScript.
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with Office documents and PDFs. Its format compatibility makes it easy to bring existing files into your workflow. Use Acrobat for the dropdown validation script described above.

Open and work with PDF documents alongside Office filesCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXFamiliar interface helps make migration from Microsoft Office easierFree and lightweight suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Why don't the fields update when I select a location?

In the dropdown's Properties > Options, enable Commit selected value immediately. Also check that each getField name matches a form field and that each case matches the option's export value, if set.

How do I add another location?

Open the dropdown's Properties > Validate > Edit and add another case before default. Set values for all four fields and end the case with break.

How can I clear the fields when no location is selected?

Keep the default section of the validation script, which assigns an empty string to each field. A blank or other unmatched dropdown value will run that section.

Will this script work in every PDF viewer?

No. The viewer must support Acrobat form JavaScript, and its settings may affect whether scripts run. Test the saved PDF in the viewer your recipients will use.