PDF Editing Issues

How to Populate an Acrobat Dropdown Based on a Text Field Value

Nimra MalikNimra Malik Nov 3, 2026 869 views

Question details

The user wants to use JavaScript in an Adobe Acrobat PDF form to automatically update or populate a dropdown menu when a specific value (like a bus number) is entered into a text field.

How to Populate a Dropdown Based on a Text Field Value in Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating dynamic, interactive PDF forms where the options or selected values in a dropdown menu change based on the user's text input.
Observed behavior
The PDF form requires a validation script to read the text field's input, map it to predefined ranges, and accurately set the corresponding dropdown item.
Before you start

Ensure you have access to the 'Prepare Form' tool in Adobe Acrobat Pro and finalize all your form field names before writing the script, as JavaScript relies on exact field name references.

Solution 1Recommended

Use a Validation Script on the Text Field

Add custom JavaScript code to the text field's validation event to check the entered value and automatically update the target dropdown.

By using the Validate event, Acrobat will run your script the moment the user finishes typing and tabs out of the text field. The script will compare the input against predefined ranges and update the dropdown accordingly.

1
Open Prepare Form tool

Open your PDF in Adobe Acrobat, navigate to the Tools menu, and select the 'Prepare Form' tool.

2
Access text field properties

Right-click the specific text field (e.g., the bus number input field) and choose 'Properties' from the context menu.

3
Set up the custom script

Navigate to the 'Validate' tab, select the 'Run custom validation script' option, and click the 'Edit' button.

4
Enter the JavaScript code

Write your JavaScript to evaluate the input and set the dropdown value. For example: if the event value is between 1991 and 1993, use getField('YourDropdownName').value = '1990 MCI'.

5
Test the form

Click 'OK' to save your script. Exit the Prepare Form mode and test the text field with valid, invalid, and blank inputs to ensure the dropdown updates correctly.

Use a Validation Script on the Text Field
Mobile Compatibility: Keep in mind that custom JavaScript validation may not function correctly on all mobile PDF viewers. Always test your interactive forms on target mobile devices if mobile usage is expected.

Create and Manage Interactive PDF Forms with WPS Office

For users who need an intuitive way to handle PDFs, WPS Office offers a comprehensive PDF editor. You can easily fill out interactive forms, edit text, and manage your documents smoothly without dealing with complex coding environments.

  1. 1. Open WPS Office: Launch WPS Office on your computer and navigate to the PDF module to open your document.
  2. 2. Access Form Tools: Click on the 'Form' tab in the top ribbon to view all available interactive form filling options.
  3. 3. Fill or Edit Fields: Click directly into the text fields, checkboxes, or dropdown menus to fill out the form seamlessly.
  4. 4. Save and Share: Once your form is complete, quickly save the PDF and share it directly with your team.
Easily fill and manage interactive PDF formsFully compatible with standard Adobe PDF formatsLightweight, fast, and user-friendly interfaceComprehensive suite including Word, Excel, and PDF tools
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't my JavaScript updating the PDF dropdown?

Check if the field names in your script exactly match the names in your form properties. Acrobat JavaScript is case-sensitive, so 'Dropdown1' and 'dropdown1' are treated as completely different fields.

Will this Acrobat form JavaScript work on mobile devices?

Not all PDF JavaScript functions work on mobile PDF readers. Many third-party mobile apps strip out or ignore custom JavaScript for security and performance reasons. It is highly recommended to test the form thoroughly on target mobile devices.

Can I hide or show fields based on a dropdown selection?

Yes, you can use JavaScript in the dropdown field's Keystroke or Validate event to change the display property of other fields. For example, setting a field's display property to 'display.hidden' or 'display.visible' based on the selected value.