PDF Editing Issues

How to Create Dynamic Drop-Down Lists in an Interactive PDF

Chanuka GeekiyanageChanuka Geekiyanage Nov 10, 2026 869 views

Question details

The user needs to create an interactive PDF form where a drop-down list automatically updates its available choices based on the selection made in a preceding radio button group.

How to Create Dynamic Drop-Down Lists in an Interactive PDF
Product
PDF
Device & OS
not provided
Scenario
Building an interactive PDF form (such as a pricing or vehicle service menu) that requires dependent form fields to change dynamically according to user input.
Observed behavior
The goal is to use JavaScript within the PDF to populate related package descriptions and prices into a drop-down list the moment a specific radio button (e.g., a vehicle type) is clicked.
Before you start

Ensure you are using a professional PDF editor that supports advanced form field properties and document-level JavaScript execution. Note the exact export values of your radio buttons and the exact field name of your target drop-down list before proceeding.

Solution 1Recommended

Use Document-Level JavaScript and Mouse Up Events

Implement a JavaScript object to map radio button selections to specific drop-down list arrays, triggered by a 'Mouse Up' action.

To make a drop-down list dynamic, you need to store your varying list options in a central document-level script. By mapping these options to the export values of your radio buttons, you can use a simple event trigger to push the new list into the target drop-down field whenever a user makes a selection.

1
Define your radio button export values

Open your PDF in form editing mode. Double-click your radio buttons to open their Properties. Navigate to the 'Options' tab and ensure each button has a distinct 'Radio Button Choice' (export value), such as 'Car', 'Truck', or 'Van'.

2
Create a document-level script

Navigate to your PDF editor's JavaScript settings and add a Document-Level Script. Create an object that stores arrays for each vehicle type. For example: var oPackageSelections = {"Car":["interior", "exterior", "full package"], "Truck":["Example1", "Example2", "Example3"], "Van":["Bla1", "Bla2", "Bla3"]};

3
Add a Mouse Up event to the radio buttons

Select all related radio buttons, open their Properties, and go to the 'Actions' tab. Set the trigger to 'Mouse Up' and the action to 'Run a JavaScript', then click Add.

4
Insert the trigger script

In the JavaScript editor window, enter the following code to retrieve and set the items: var aNewItems = oPackageSelections[event.target.value]; this.getField("PackageDropdown").setItems(aNewItems); (Replace 'PackageDropdown' with the actual name of your drop-down field).

5
Test the form combinations

Exit form editing mode and click through each radio button. Verify that the drop-down list accurately updates to display the choices corresponding to the selected radio button.

Use Document-Level JavaScript and Mouse Up Events
Testing is Crucial: Always test every single combination of radio buttons to ensure your export values precisely match the keys in your JavaScript object. JavaScript is case-sensitive.

Easily Create and Manage Interactive PDF Forms with WPS Office

WPS Office provides a comprehensive PDF editor that allows you to view, fill, and create interactive PDF forms effortlessly. Whether you are adding text fields, combo boxes, or formatting drop-down lists, WPS Office streamlines your document workflow.

  1. 1. Open your PDF in WPS Office: Launch WPS Office and open your PDF document. Switch to the 'Form' tab in the top navigation ribbon to access the interactive form tools.
  2. 2. Insert a Combo Box: Select 'Combo Box' or 'Drop-down List' from the toolbar, then click and drag on the document page to position your new drop-down field.
  3. 3. Configure Field Properties: Double-click the newly inserted drop-down field to open its Properties. Navigate to the 'Options' tab to manually add your item names and define their respective export values.
  4. 4. Save and distribute: Once your list is configured, save the PDF. Your document is now ready to be securely distributed and filled out by users.
Fully compatible with standard interactive PDF forms and Adobe Acrobat formats.Intuitive form-building tools to easily insert combo boxes and drop-down lists.Lightweight architecture ensures fast loading and smooth form-filling experiences.Cross-platform support allows you to manage PDF forms on Windows, Mac, and mobile devices.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my drop-down list not updating when I click the radio button?

This commonly occurs if the export values assigned to your radio buttons do not exactly match the key names defined in your JavaScript object. JavaScript is strictly case-sensitive. Additionally, verify that the field name referenced in the 'this.getField()' method is spelled exactly like the drop-down field's name.

Can I use this JavaScript method to update other text fields automatically?

Yes. You can expand your Mouse Up script to not only use 'setItems()' for drop-down lists but also 'this.getField("FieldName").value = newValue;' to automatically populate prices or descriptions in standard text fields based on the selected package.

Will these dynamic drop-down lists work in all PDF viewers?

Not necessarily. Dynamic lists rely on Acrobat-compatible JavaScript. While professional desktop PDF editors like standard Adobe Acrobat and robust office suites will run the scripts correctly, some basic web-browser PDF viewers or limited mobile apps may strip or ignore the JavaScript, causing the form to remain static.