PDF Editing Issues

Calculate a PDF Form Value from a Drop-Down and Radio Button in Adobe Acrobat

Huma Ashraf ChHuma Ashraf Ch Nov 19, 2026 869 views

Question details

Calculate a PDF form field value based on a drop-down selection and a radio-button choice.

Calculate a PDF Form Value from a Drop-Down and Radio Button in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form needs to return a price or other value for each combination of two form inputs.
Observed behavior
The calculated field should display the value associated with the selected drop-down and radio-button combination.
Before you start

Open the form in Adobe Acrobat and check the exact field names and export values for the drop-down options and radio buttons. Make sure the output field is a text field that can run a custom calculation script.

Solution 1Recommended

Use a custom calculation script to look up each combination

Use this method when each drop-down and radio-button combination has a predefined result.

The example uses a drop-down field named Plan, a radio-button group named Coverage, and a calculated text field named Price. Replace the names, export values, and prices with those from your form.

The script reads valueAsString as a property, combines the two values into a key, and assigns the matching price to event.value. It leaves the result blank when no combination matches.

1
Check the input fields

Open All tools > Prepare a form, then open the properties of the drop-down and radio-button fields. Confirm their field names and option export values; this example expects Plan values Standard and Premium and Coverage values Yes and No.

2
Open the output calculation

In Prepare a form, open the Price text field's properties, select the Calculate tab, and choose Custom calculation script. Click Edit.

3
Enter the lookup script

Paste this script into the JavaScript editor and adjust the names and lookup entries: var plan = this.getField("Plan").valueAsString; var coverage = this.getField("Coverage").valueAsString; var key = plan + "|" + coverage; var options = ["Standard|Yes", "Standard|No", "Premium|Yes", "Premium|No"]; var prices = [120, 100, 220, 200]; event.value = ""; for (var i = 0; i < options.length; i++) { if (key === options[i]) { event.value = prices[i]; break; } }

4
Save and test the form

Click OK to close the script editor and field properties, then use Preview in Prepare a form. Select each drop-down and radio-button combination and confirm that Price displays the intended result.

Use a custom calculation script to look up each combination
Match export values exactly: The lookup keys must match the values returned by the fields, which may differ from visible labels. An unselected radio-button group can return Off, so the example leaves the result blank until a listed combination is selected.
Free Microsoft Office alternative

Work with documents and PDFs 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 move existing files into your workflow. Use Adobe Acrobat for the Acrobat-specific form calculation script described above; WPS does not fix or replace that scripting workflow.

Open and work with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTX.Access PDF tools alongside documents, spreadsheets, and presentations.Use a familiar interface that makes switching from Microsoft Office easier.Get a free, lightweight office suite for everyday work.
microsoft office alternative - wps office

Frequently Asked Questions

Where do I enter the Acrobat calculation script?

Open All tools > Prepare a form, open the output text field's properties, and select Calculate > Custom calculation script > Edit.

Why is my calculated field blank?

Check that the field names in this.getField match the form exactly and that each lookup key uses the actual drop-down and radio-button export values. The example also returns a blank if no listed combination matches.

Can I use the visible labels instead of export values?

The script compares the values returned by the fields, which can differ from visible labels. Check the drop-down options and radio-button properties in Prepare a form, then use the returned values in the options array.

How do I add another price combination?

Add a new combined key to the options array and its corresponding result at the same position in the prices array. Test the new selection in Preview.