PDF Editing Issues

How to Display Prices from Radio Buttons or Checkboxes in PDF Forms

Steve KSteve K Oct 28, 2026 869 views

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.

How to Display Prices from Radio Buttons or Checkboxes in PDF Forms
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.
Before you start

Ensure you have a professional PDF editing application installed that supports form creation and custom JavaScript calculations, such as Adobe Acrobat Pro.

Solution 1Recommended

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.

1
Configure the Checkbox or Radio Button

Open your PDF in Form Editing mode. Right-click your checkbox or radio button group (e.g., 'TShirt1') and select 'Properties'.

2
Set the Export Value

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.

3
Create the Target Price Field

Add a new Text Field to your document where the price should appear, and name it appropriately (e.g., 'Price1').

4
Add the Custom Calculation Script

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;`.

Use Export Values and Custom JavaScript to Display Prices
Script Customization: Ensure the field name inside the getField("...") parameter exactly matches the name of your checkbox or radio button group. JavaScript is case-sensitive.
Free PDF & Office Suite

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. 1. Download WPS Office: Install WPS Office on your computer or mobile device from the official website.
  2. 2. Open your PDF Form: Launch the WPS PDF tool and open your interactive PDF file containing the radio buttons or checkboxes.
  3. 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.
Smoothly read, fill out, and print interactive PDF forms on any device.Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight installation with an intuitive, tabbed user interface.Completely free to download for basic PDF viewing and office tasks.
microsoft office alternative - wps office

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.