PDF Editing Issues

How to Change Checkbox Prices Using Acrobat JavaScript in PDF Forms

Bushra ParveenBushra Parveen Nov 3, 2026 869 views

Question details

The user wants to dynamically adjust a product price from 900 to 650 in a PDF form if any of three specific checkboxes are selected.

How to Change Checkbox Prices Using Acrobat JavaScript in PDF Forms
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating an interactive PDF form with conditional pricing based on user selections.
Observed behavior
The user needs a script to calculate the price conditionally, as relying solely on checkbox appearance does not update the underlying value correctly.
Before you start

Ensure that all checkboxes in your PDF form have unique field names and specified export values before adding the JavaScript calculation.

Solution 1Recommended

Add a Custom Calculation Script to the Price Field

Use a custom JavaScript calculation in the price field to check the status of the related checkboxes and set the price accordingly.

By applying a custom calculation script directly to the price field, the value updates automatically whenever a user interacts with the linked checkboxes. This ensures the underlying data is accurate for any subsequent total calculations.

1
Open Field Properties

Open your PDF form in edit mode, right-click the target Price field, and select Properties from the context menu.

2
Navigate to the Calculate Tab

In the Properties dialog box, click on the 'Calculate' tab to view calculation options.

3
Enter the Custom Script

Select 'Custom calculation script' and click the 'Edit' button. Enter the following script: var discount = this.getField("A").value !== "Off" || this.getField("B").value !== "Off" || this.getField("C").value !== "Off"; event.value = discount ? 650 : 900;

4
Customize Field Names

Replace "A", "B", and "C" in the script with the actual field names of your checkboxes, then click OK to save.

Add a Custom Calculation Script to the Price Field
Calculation Order: Make sure to set the field calculation order so that this price field calculates before any grand total fields.
Efficient PDF Form Editing

Edit and Fill Interactive PDF Forms with WPS Office

WPS Office provides an excellent suite for filling, signing, and managing interactive PDF forms seamlessly across all your devices, ensuring embedded calculations run smoothly.

  1. 1. Download WPS Office: Download and install WPS Office from the official website.
  2. 2. Open the PDF Form: Launch WPS PDF and open your interactive PDF form.
  3. 3. Fill the Form: Click on the form fields to fill in the required information; calculations will trigger automatically.
  4. 4. Save and Export: Save your completed form securely or export it as needed.
Easily fill out complex interactive PDF forms with embedded JavaScriptHigh compatibility with standard PDF formats and Adobe Acrobat scriptsLightweight application that won't slow down your deviceEdit PDF text, images, and pages directly
microsoft office alternative - wps office

Frequently Asked Questions

Why is my PDF calculation script not updating the total?

This usually happens if the field calculation order is incorrect. Ensure that the individual price fields are calculated before the grand total field in the form properties.

What is the default export value for unchecked checkboxes in PDFs?

By default, an unchecked checkbox in a PDF form returns the value "Off". You must check against this value in your JavaScript to determine if it is selected.

Can I use this JavaScript logic for dropdown menus instead of checkboxes?

Yes, you can adapt the script by replacing the checkbox field names with your dropdown field names and checking against their specific export values instead of "Off".