PDF Editing Issues

Keep an Adobe Acrobat Form Calculation Field Blank When Zero

Steve KSteve K Nov 18, 2026 869 views

Question details

Keep a calculated total entry fee field blank when its value is zero so it can be filled in by hand after printing.

Keep an Adobe Acrobat Form Calculation Field Blank When Zero
Product
Adobe Acrobat PDF form
Device & OS
not provided
Scenario
A cook-off form calculates an entry fee from selected categories and may be printed before any categories are selected.
Observed behavior
The Total Entry Fee field displays 0.00 when no category is selected instead of remaining blank.
Before you start

Open the PDF in Adobe Acrobat and confirm that you can edit the Total Entry Fee form field. Locate the existing calculation script and identify the variable that holds the final total.

Solution 1Recommended

Return a Blank Value When the Calculated Total Is Zero

Use this change in the existing custom calculation script to hide zero while retaining nonzero totals.

1
Open the form field properties

In Adobe Acrobat, open All tools > Prepare a form, then double-click the Total Entry Fee field.

2
Edit the calculation script

Select the Calculate tab, choose Custom calculation script, and click Edit. Keep the existing code that calculates the total.

3
Set the displayed value

After the code that calculates the total, use this assignment, replacing total with the name of your total variable if needed: if (total == 0) { event.value = ""; } else { event.value = total; }

4
Test and save the form

Click OK to close the script editor and field properties. Test the form with no categories selected and with one or more selected, then use File > Save to save the PDF.

Return a Blank Value When the Calculated Total Is Zero
Zero totals remain blank: This condition hides any total equal to zero, even if a category is selected. A nonzero total is still displayed.
Free Microsoft Office alternative

Work With PDFs and Office Files in WPS Office

WPS Office is a free, lightweight alternative for everyday PDF and Office work, with a familiar interface and support for common Microsoft Office formats to make switching easier. The Acrobat JavaScript calculation must still be edited in Adobe Acrobat.

Open and work with PDFs alongside your other documentsCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXFamiliar tools make the transition from Microsoft Office easierFree, lightweight suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Will the field still show a calculated entry fee?

Yes. The script assigns the calculated total to event.value whenever the total is not zero.

Where can I find the calculation script in Acrobat?

Open All tools > Prepare a form, double-click the total field, and select Calculate > Custom calculation script > Edit.

What if my script uses a variable other than total?

In the Custom calculation script editor, replace total in both parts of the condition with the variable that contains your final calculated amount.

Can I write the fee in by hand after printing?

Yes. When the calculated total is zero, the empty field should print without 0.00, leaving space for a handwritten amount. Preview or print a test copy to check the result.