PDF Editing Issues

Create a Radio Button and Dropdown Calculation in Adobe Acrobat

Emma BrownEmma Brown Nov 25, 2026 868 views

Question details

Create a PDF form calculation that uses a radio button, a numeric text field, and a dropdown rate.

Create a Radio Button and Dropdown Calculation in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A form needs to apply a tiered calculation when a radio button is set to Yes.
Observed behavior
The calculated field should display the tiered result when Yes is selected and remain blank otherwise.
Before you start

Open the form in Adobe Acrobat and confirm the names of the radio button, text field, dropdown, and calculated field. Check that the Yes radio button has the export value Yes and that dropdown export values are numeric decimals, such as 0.02 for 2%.

Solution 1Recommended

Add a Custom Calculation Script to the Result Field

Use this method when the calculation must run inside the Acrobat PDF form.

The script applies the dropdown rate to the first tier and uses 5% for the remaining amount. It leaves the result blank when Yes is not selected or an input is empty or nonnumeric.

1
Check the form fields

Open All tools > Prepare a form, then open each field's Properties. Confirm the field names RBField1, TextField1, and Dropdown1, and check the radio button and dropdown export values under Options. Substitute your actual field names in the script if they differ.

2
Open the calculation editor

Double-click the result text field, select the Calculate tab, choose Custom calculation script, and click Edit.

3
Enter the script

Paste this script into the JavaScript editor and click OK: if (this.getField("RBField1").valueAsString == "Yes") { var amountText = this.getField("TextField1").valueAsString; var rateText = this.getField("Dropdown1").valueAsString; var amount = Number(amountText); var rate = Number(rateText); if (amountText.replace(/\s/g, "") == "" || rateText.replace(/\s/g, "") == "" || !isFinite(amount) || !isFinite(rate)) { event.value = ""; } else if (amount < 5000.01) { event.value = amount * (0.05 + rate); } else { event.value = ((amount - 5000) * 0.05) + (5000 * (0.05 + rate)); } } else { event.value = ""; }

4
Set the calculation order

In Prepare a form, open More > Set Field Calculation Order. If the amount or dropdown value depends on another calculated field, place the result field after those fields.

5
Test the form

Close form editing and select Yes, enter an amount, and choose a dropdown rate. Test amounts below and above 5,000, then select No and confirm that the result becomes blank.

Add a Custom Calculation Script to the Result Field
Existing scripts: If the result field already has a custom calculation script, review and combine its logic rather than overwriting it. Test the saved PDF in Acrobat because JavaScript support varies among PDF viewers.
Calculate in WPS Spreadsheets

Calculate the Same Tiers in WPS Spreadsheets

Use WPS Spreadsheets to calculate the same tiers with Yes or No and numeric rate inputs. This is a spreadsheet alternative; it does not add an Acrobat JavaScript calculation to the PDF form.

  1. 1. Create a worksheet: Open WPS Office, select Spreadsheets, and create a blank workbook.
  2. 2. Enter the inputs: Enter Yes or No in cell A2, the amount in B2, and the numeric rate in C2. For example, enter 0.02 for a 2% rate.
  3. 3. Add the formula: In D2, enter =IF(A2="Yes",IF(B2<5000.01,B2*(0.05+C2),(B2-5000)*0.05+5000*(0.05+C2)),"").
  4. 4. Check and save: Change A2 to No to confirm D2 becomes blank, then use File > Save As to save the workbook as an XLSX file.
Calculate the tiered result from a selection, amount, and rateOpen and save Microsoft Excel XLSX filesEdit inputs and formulas in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why is the calculation blank when I select Yes?

In Prepare a form, check that the selected radio button's export value is exactly Yes and that the field names in the script match the names in Properties. Also check that the amount and dropdown export value are numeric.

Should the dropdown export value be a percentage or a decimal?

Use a numeric decimal export value, such as 0.02 for 2%. You can display a more readable label in the dropdown while setting its export value under the field's Options properties.

How is an amount above 5,000 calculated?

For amounts of 5,000.01 or more, the script applies 5% plus the dropdown rate to the first 5,000 and 5% to the remainder. Amounts below 5,000.01 use the combined rate for the entire amount.

Will the calculation work in every PDF viewer?

Not necessarily. PDF viewers vary in their support for Acrobat JavaScript. Open the saved form in Acrobat and test the radio button, dropdown, and result field.