PDF Editing Issues

Replace a PDF Drop-Down Export Value with JavaScript in Adobe Acrobat

Anum MushtaqAnum Mushtaq Nov 19, 2026 869 views

Question details

Replace the export value 0 with 10 when a user selects an option in the PDF drop-down field fund1.

Replace a PDF Drop-Down Export Value with JavaScript in Adobe Acrobat
Product
Adobe Acrobat PDF forms
Device & OS
not provided
Scenario
A PDF form uses a drop-down field named fund1 with export values that need to be adjusted by JavaScript.
Observed behavior
Changing the drop-down from a separate calculation script produces a set-not-possible error.
Before you start

Open the form in an Acrobat edition that can edit PDF form fields. Check that fund1 has options with export values 0 and 10, and that form calculations are enabled.

Solution 1Recommended

Run the replacement script in the drop-down calculation event

Use the field's own calculation event to replace the selected export value without setting the field from a separate calculation script.

1
Open the form editor

In Adobe Acrobat, open the PDF and select All tools > Prepare a form.

2
Check the export values

Double-click the fund1 drop-down and open the Options tab. Confirm that its options include export values 0 and 10.

3
Add the calculation script

In the field properties, open the Calculate tab, select Custom calculation script, and click Edit. Enter: if (event.value == "0") event.value = "10";

4
Test the selection

Save the form, exit form editing, and select the option whose export value is 0. Verify that the resulting export value is 10. If the change is delayed, check the drop-down's Options tab for Commit selected value immediately and test again.

Run the replacement script in the drop-down calculation event
Displayed labels and export values: The visible label may differ from the export value. If you only need to display 10 without changing the selection, use a separate calculated text field instead.
Free Microsoft Office alternative

Work with PDFs and Office documents in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. It supports a smooth move from Microsoft Office, but it does not replace Acrobat's PDF form calculation scripting tools.

Open and view PDF forms alongside your other documentsCompatible with Microsoft Office formats, including DOCX, XLSX, and PPTXFamiliar interface for moving between documents, spreadsheets, and presentationsFree, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the separate calculation script produce a set-not-possible error?

The script is attempting to change the drop-down from another field's calculation event. Put the replacement logic in fund1's own Calculate > Custom calculation script and assign the result to event.value instead.

Where can I check a drop-down option's export value?

In Acrobat, choose All tools > Prepare a form, double-click fund1, and open its Options tab. Check the export values assigned to the listed options.

How can I make the value change as soon as an option is selected?

In the drop-down field's Options tab, enable Commit selected value immediately if it is available. Then exit form editing and test the selection to confirm when the calculation runs.

What if I only want to show 10 without changing the drop-down?

Leave fund1 unchanged and add a separate text field in Prepare a form. Use that text field's Calculate tab to calculate the displayed value from fund1.