Calculate PDF Form Fees from a Checkbox and Sales Price in Adobe Acrobat
Question details
Create PDF form calculations that populate three fees when the One Plan checkbox is selected.

- Product
- Adobe Acrobat PDF forms
- Device & OS
- not provided
- Scenario
- A form uses a sales price and a One Plan checkbox to determine a sales-price-based fee, a compliance fee, and a risk-management fee.
- Observed behavior
- The desired form should calculate the applicable fees when One Plan is selected and show zero or a blank value when it is not selected.
Confirm the fee amounts and whether each $200,000 sales-price increment is rounded up or down. Decide whether unchecked fees should display zero or remain blank, and identify the form field names.
Add custom calculation scripts to the Acrobat fee fields
Use separate fields and checkbox-based scripts to calculate each fee when One Plan is selected.
The examples below use zero as a placeholder for each fee amount. Replace those values with the agreed amounts before using the form. They also show zero when the checkbox is unchecked.
The sales-price example calculates a fee per $200,000 increment. Use Math.ceil to round a partial increment up, or Math.floor to round it down, only after confirming the applicable rule.
In Acrobat, open the PDF and choose All tools > Prepare a form. Add a checkbox named OnePlan and separate text fields named SalesPrice, SalesFee, ComplianceFee, and RiskFee. Set the price and fee fields to a numeric or currency format in their Properties.
Open SalesFee Properties, select Calculate > Custom calculation script, and click Edit. Enter this script, replacing the zero fee placeholder and changing Math.ceil to Math.floor if partial increments must be rounded down: var checked = this.getField('OnePlan').value !== 'Off'; var raw = this.getField('SalesPrice').value; var price = Number(String(raw).replace(/[$,\s]/g, '')); var feePerIncrement = 0; // Replace with the fee per $200,000 increment. event.value = checked && price > 0 && isFinite(price) ? Math.ceil(price / 200000) * feePerIncrement : 0;
In ComplianceFee Properties > Calculate > Custom calculation script > Edit, enter: event.value = this.getField('OnePlan').value !== 'Off' ? 0 : 0; Replace the first 0 with the compliance fee. Repeat in RiskFee, replacing the first 0 with the risk-management fee.
In Prepare a form, open the form options and choose Set Field Calculation Order if the fields depend on other calculated fields. Save the PDF, then enter test sales prices and toggle One Plan to verify all three fees, including prices on and between $200,000 boundaries.

Use WPS Office for everyday documents and PDF tasks
WPS Office is a free, lightweight alternative with a familiar interface and support for common Office formats, making it easy to move everyday work. It also offers PDF tools, but use Acrobat to create and verify the JavaScript calculations described above.

Frequently Asked Questions
How does the script know whether the checkbox is selected?
The script reads the OnePlan field value and compares it with 'Off', the unchecked value. Use the exact checkbox field name from Acrobat's Prepare a form tool.
How can I show blank fees instead of zero when One Plan is unchecked?
In each fee field's custom calculation script, replace the unchecked result of 0 with an empty string, ''. Test the field's numeric formatting in Acrobat to confirm it displays as intended.
Should a partial $200,000 increment be rounded up?
That depends on the fee rule. Math.ceil(price / 200000) rounds a partial increment up; Math.floor(price / 200000) rounds it down. Confirm the rule before choosing one.
Why might the calculations not work in another PDF viewer?
Some PDF viewers do not support Acrobat JavaScript or handle form calculations differently. Open the saved form in the intended viewer and test the checkbox and fee fields before distributing it.




