PDF Editing Issues

Clear a Calculated Date Field When the Balance Is Zero in Adobe Acrobat

Steven ParkerSteven Parker Nov 19, 2026 868 views

Question details

Clear a calculated deduction date when the form's balance reaches zero.

Clear a Calculated Date Field When the Balance Is Zero in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
An Acrobat form calculates a future deduction date from an input date and stores it in the DateDeducted field.
Observed behavior
The date field should remain blank when the calculated balance is $0.00.
Before you start

Open the form in Acrobat and identify the exact name of the balance field and the existing DateDeducted calculation script. Make sure the balance field's underlying value is numeric, even if it displays as currency.

Solution 1Recommended

Check the Balance in the Date Field's Calculation Script

Use this method when DateDeducted should be cleared based on a separate balance field.

1
Open the form editor

Open the PDF in Adobe Acrobat and select Prepare a form. Double-click the DateDeducted field to open its properties.

2
Edit the calculation

On the Calculate tab, open the custom calculation script. Keep the existing date calculation, then add this code after it: var b = this.getField("Balance").value; if (b !== "" && !isNaN(Number(b)) && Number(b) === 0) event.value = ""; Replace Balance with the exact name of your balance field.

3
Check calculation order

In Prepare a form, open the More menu and choose Set Field Calculation Order. Place the balance calculation before DateDeducted so the date script checks the updated balance.

4
Test the form

Close the field properties and preview or use the form. Enter values that produce a positive balance and then a zero balance; confirm the date appears for the former and is blank for the latter.

Check the Balance in the Date Field's Calculation Script
Check the balance value: The script expects a numeric balance or a numeric string such as 0.00. A formatted string such as $0.00 must be converted to a number before comparison. A validation script that checks event.value alone only tests the date field's own value, not a separate balance.
Free Microsoft Office alternative

Work With PDF and Office Files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDF and Microsoft Office files. Its format compatibility helps you move existing documents into your workflow. It does not fix or replace Acrobat's form calculation scripts.

Open and review PDF forms alongside other documentsCompatible with Microsoft Office formats, including DOCX, XLSX, and PPTXFamiliar interface for a smoother transition from Microsoft OfficeFree, lightweight tools for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't checking the date field for zero clear it when the balance is zero?

The date field's event.value refers to the date field itself, not the separate balance. In the DateDeducted calculation script, use this.getField with the balance field's exact name to check the balance.

Where do I find the field names in Acrobat?

Open Prepare a form and inspect the fields in the editor. Double-click a field and check its name in the field properties before using that name in a script.

Why is the date still showing after the balance reaches zero?

Check that the script uses the correct balance field name and that its underlying value is numeric. Also open More > Set Field Calculation Order in Prepare a form and ensure the balance calculates before DateDeducted.

Can I use a validation script to clear a field containing zero?

Yes. In the field's properties, open Validate and add the custom validation script if (event.value == 0) event.value = "";. This checks that field's own value; it does not check a separate balance field.