Reset a PDF Form Total to Zero When Fields Are Blank
Question details
Reset a PDF form total to zero when the quantity and price fields are cleared.

- Product
- PDF form editor
- Device & OS
- not provided
- Scenario
- A form calculates a total from quantity and price fields.
- Observed behavior
- The total continues to show a previous calculation after the source fields are cleared.
Open the PDF in an editor that supports form calculations, such as Adobe Acrobat Pro. Identify the total field and check whether the quantity and price fields are entered manually or calculated from other fields.
Check the PDF form field calculation order
Use this when the total depends on other calculated fields that may not be updating first.
Only calculated fields need to be arranged in the calculation order. Manually entered fields do not need to be placed before the total.
In Adobe Acrobat Pro, open the PDF and select All tools > Prepare a form.
In the form editing tools, select More > Set field calculation order.
Select any calculated quantity or price fields and use the move controls to place them before the total field. Select OK to apply the order.
Select Preview, enter a quantity and price, then clear both fields. Check whether the total recalculates to zero; if it retains a value, check the total field's calculation settings or script.

Set the total to zero with a calculation script
Use a custom calculation when the total must explicitly return zero for blank source fields.
Work with PDF forms and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility for an easy move between applications. Use a PDF editor that supports form calculation order and scripts for the specific fix above.

Frequently Asked Questions
Why does my PDF total show an old value after I clear the fields?
A dependent calculated field may run after the total, or the total's script may not assign a new value when inputs are blank. In Acrobat Pro, check More > Set field calculation order and the total field's Calculate properties.
Do manually entered quantity and price fields need a calculation order?
No. The calculation order applies to calculated fields. If quantity or price is calculated from other fields, place those calculations before the total.
Can I show a blank total instead of zero?
Yes. In the total field's custom calculation script, check whether both source values are blank and assign event.value = "" in that case. Keep the normal calculation for other inputs.
Can I change the calculation order in a PDF viewer?
A basic PDF viewer may let you fill the form but not edit its calculations. Use a form editor such as Acrobat Pro and open All tools > Prepare a form to change the order.




