PDF Editing Issues

How to Create a Dependent Drop-Down List or Price Field in PDF Forms

Ayan MasoodAyan Masood Nov 2, 2026 869 views

Question details

The user wants a secondary PDF form field (such as a price) to automatically update and display a specific value when an option is selected from a drop-down list.

How to Create a Dependent Drop-Down List or Price Field in PDF Forms
Product
Adobe Acrobat / PDF Forms
Device & OS
not provided
Scenario
Creating interactive PDF forms where conditional or dependent fields need to auto-populate based on a user's previous selection.
Observed behavior
A programmatic solution or custom script is needed to link the selection from the source drop-down field to the output value of the destination field.
Before you start

Ensure that your PDF editor supports JavaScript calculations. Before proceeding, you should have already created the source drop-down field (e.g., 'spaceSize') and the destination text field (e.g., 'Price') in your PDF document.

Solution 1Recommended

Use Custom JavaScript for Field Calculations

Add a custom calculation script to the target text field to map the drop-down options to specific output values.

To make a field dependent on a drop-down list, you can use a basic JavaScript array to map the selections to their respective prices. This script runs on the target field and listens to the values of the source field.

1
Open target field properties

Open your PDF form in Edit mode, right-click the destination text field where the price should appear, and select 'Properties'.

2
Navigate to the Calculate tab

In the Properties window, click on the 'Calculate' tab to view the calculation options for this specific field.

3
Enter the custom JavaScript

Select the 'Custom calculation script' option and click the 'Edit' button. Enter the following script, replacing the field name and values with your own: var prices = {'10x10':'$50', '10x20':'$100'}; event.value = prices[this.getField('spaceSize').value] || '';

4
Commit selected value immediately

Click 'OK' to save the script. Next, open the Properties for your source drop-down list, go to the 'Options' tab, and check the box for 'Commit selected value immediately' so the price updates instantly when a user makes a selection.

Use Custom JavaScript for Field Calculations
Script Customization: You can add as many options as you need to the 'prices' array by following the same 'Option':'Value' syntax.
Advanced PDF Form Editing

Create and Manage Interactive PDF Forms with WPS Office

WPS Office provides robust and easy-to-use PDF editing tools. You can quickly design interactive forms, add drop-down lists, and manage text fields without needing heavy or expensive software.

  1. 1. Open PDF Editor: Launch WPS Office and open your PDF document using the built-in PDF editor.
  2. 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to reveal the interactive form creation tools.
  3. 3. Add Fields: Select 'Combo Box' to insert a drop-down list or 'Text Field' for text inputs, then place them onto your document.
  4. 4. Configure Properties: Double-click the inserted fields to configure their properties, add drop-down options, or set formatting rules.
Easily create interactive PDF forms with text fields, checkboxes, and drop-down lists.Fully compatible with standard Adobe Acrobat PDF formats and interactive elements.Lightweight, fast-loading, and runs smoothly on Windows, Mac, and mobile devices.Cost-effective alternative featuring built-in PDF conversion, editing, and signature tools.
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't my dependent price field updating when I select a new option?

This usually happens because the PDF form waits for the user to click away from the drop-down before calculating. To fix this, open the properties of your drop-down list, go to the 'Options' tab, and check 'Commit selected value immediately'.

Can I use this JavaScript calculation for more than two drop-down options?

Yes. You can expand the JavaScript array to include as many key-value pairs as needed. Just ensure each option is separated by a comma, like this: var prices = {'10x10':'$50', '10x20':'$100', '10x30':'$150'};

Will this dependent drop-down list work in other PDF readers?

Yes, form calculations using standard JavaScript are widely supported. As long as the user's PDF reader supports interactive forms and JavaScript is enabled in their settings, the auto-population will work properly.