How to Display Prices from Radio Buttons or Checkboxes in PDF Forms
Question details
The user needs to dynamically display product or subscription prices in a PDF form text field based on the selections made via radio buttons or checkboxes.

- Product
- PDF Forms
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF order form or subscription grid where checking a box or selecting a radio button (like a size or subscription tier) automatically updates a dedicated price field.
- Observed behavior
- The goal is to properly configure export values for choices and use a custom calculation script to pull the selected export value into a price display field.
Ensure you have a professional PDF editing application installed that supports form creation and custom JavaScript calculations, such as Adobe Acrobat Pro.
Use Export Values and Custom JavaScript to Display Prices
Assign prices directly as export values to your checkboxes or radio buttons, then apply a custom calculation script in the target text field to read and display the selected amount.
This method relies on setting the actual monetary value as the 'Export Value' of your selection field. A simple JavaScript snippet in the target price field will listen for changes and populate the correct amount or leave it blank if nothing is selected.
Open your PDF in Form Editing mode. Right-click your checkbox or radio button group (e.g., 'TShirt1') and select 'Properties'.
Navigate to the 'Options' tab. In the 'Export Value' (or 'Radio Button Choice') field, enter the exact price you want to charge for this selection.
Add a new Text Field to your document where the price should appear, and name it appropriately (e.g., 'Price1').
Right-click your new Text Field ('Price1'), choose 'Properties', and go to the 'Calculate' tab. Select 'Custom calculation script', click the 'Edit' button, and paste the following code: `var v = this.getField("TShirt1").valueAsString; event.value = (v == "Off") ? "" : v;`.

Easily Fill and Manage Interactive PDF Forms with WPS Office
While advanced JavaScript form creation requires specialized form editors, WPS Office provides an incredibly smooth experience for filling out interactive PDF forms, viewing calculated results, and managing all your document needs in one lightweight suite.
- 1. Download WPS Office: Install WPS Office on your computer or mobile device from the official website.
- 2. Open your PDF Form: Launch the WPS PDF tool and open your interactive PDF file containing the radio buttons or checkboxes.
- 3. Fill and Save: Click the form fields to select your options and trigger built-in calculations, then easily save or print the completed document.

Frequently Asked Questions
Why is my PDF form calculation script not updating the price?
This usually happens if the field names in your script do not exactly match the actual field names in the form. Check for typos and case sensitivity. Also, ensure that JavaScript is enabled in your PDF viewer's preferences.
Can I sum multiple calculated fields to get a grand total?
Yes. Create a new text field for the grand total, go to its 'Calculate' properties tab, choose 'Value is the sum (+) of the following fields:', and select all the individual price fields you want to add together.
What is the difference between an export value and a field name in a PDF form?
The field name is the unique identifier for the form element itself, while the export value is the specific data (like a price) that is sent, exported, or used in calculation scripts when that specific option is selected by the user.




