PDF Editing Issues

Set Shipping Cost Based on Order Total in Adobe Acrobat PDF Forms

Muhammad TalhaMuhammad Talha Nov 19, 2026 868 views

Question details

Set a PDF form's shipping cost automatically based on its order total.

Set Shipping Cost Based on Order Total in an Acrobat PDF Form
Product
Adobe Acrobat
Device & OS
not provided
Scenario
An order form should charge $12.99 shipping for totals below $300 and $0 for totals of $300 or more.
Observed behavior
The shipping field should update when the order total changes, while remaining $0 if the total is blank.
Before you start

Open the form in Adobe Acrobat and check the exact name of the order total field in Prepare a Form. Make sure its value is a plain number that JavaScript can convert, without currency symbols or thousands separators.

Solution 1Recommended

Add a Custom Calculation Script to the Shipping Field

Use this method to calculate shipping automatically from the order total in an Acrobat PDF form.

1
Open the form editor

Open the PDF in Adobe Acrobat, then select All tools > Prepare a form.

2
Open shipping field properties

Double-click the shipping cost field, or right-click it and select Properties. Open the Calculate tab.

3
Enter the calculation

Select Custom calculation script, click Edit, and enter: var total = Number(this.getField("product total").valueAsString); if (this.getField("product total").valueAsString != "" && total < 300) event.value = 12.99; else event.value = 0; Replace "product total" with the exact name of your order total field if it differs.

4
Save and test

Click OK, close the field properties, and save the PDF. Enter totals such as 299.99 and 300 to verify that shipping changes to $12.99 and $0, respectively.

Add a Custom Calculation Script to the Shipping Field
Blank totals: The script sets shipping to $0 when the order total is blank. It also requires a PDF viewer that supports Acrobat form calculations and JavaScript.
Free Microsoft Office alternative

Work With PDF Order Forms and Office Files in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface for working with PDFs and common Office files. Its format compatibility makes it easy to move everyday documents and spreadsheets between suites. Use Adobe Acrobat to add and test the custom PDF form calculation described above.

Open and review PDF order forms alongside other business documentsCompatible with Microsoft Office formats, including DOCX, XLSX, and PPTXFamiliar interface for a smoother move from Microsoft OfficeFree, lightweight tools for everyday office work
QA img-9

Frequently Asked Questions

What happens when the order total is exactly $300?

The script sets shipping to $0 because the $12.99 charge applies only when the total is less than 300.

Where do I find the order total field's name?

In Acrobat, open All tools > Prepare a form and double-click the order total field. Check its name in the field properties, then use that exact name in both getField references.

Why does the shipping field stay at $0 when the total is blank?

The script checks for an empty order total and sets shipping to $0 until a value is entered.

Why might the calculation not work in another PDF viewer?

The viewer must support Acrobat form calculations and JavaScript. Test the saved form in Acrobat or another compatible PDF viewer, and check that JavaScript is enabled.

Can the script read a total with a currency symbol or comma?

The Number conversion in this script expects a plain numeric value. Check the total field's value and formatting if it includes a currency symbol or thousands separator.