PDF Editing Issues

Show an Acrobat Form Alert When a Calculation Is Below a Limit

Ayan MasoodAyan Masood Nov 19, 2026 868 views

Question details

Create a dismissible reminder when Total divided by DropFreq is less than 1,000, while allowing the PDF form to be saved.

Show an Acrobat Form Alert When a Calculation Is Below a Limit
Product
Adobe Acrobat Pro
Device & OS
not provided
Scenario
A PDF form calculates a ratio from the Total and DropFreq fields and needs to notify the user when the result falls below a limit.
Observed behavior
The desired alert should appear for a valid ratio below 1,000 and allow the user to dismiss it and continue saving the form.
Before you start

Open the PDF in Acrobat Pro and confirm that the form fields are named Total and DropFreq, or adjust those names in the script. JavaScript must be enabled in Acrobat for the calculation and alert to run.

Solution 1Recommended

Add a hidden calculation field with an informational alert

Use this method to check the ratio during form recalculation without rejecting the entered values.

The alert is modal while it is displayed, but the user can dismiss it and continue working or saving. It may appear more than once because Acrobat can recalculate fields after other form changes.

1
Create a calculation field

Open the PDF in Acrobat Pro, choose All tools > Prepare a form, and add a text field. Give it a distinct name such as RatioCheck.

2
Hide the field

Open the new field's Properties, select the General tab, and set Form Field to Hidden.

3
Add the calculation script

In the field's Properties, open Calculate, select Custom calculation script, and click Edit. Enter the following script: var totalText = String(this.getField("Total").valueAsString).trim(); var freqText = String(this.getField("DropFreq").valueAsString).trim(); var total = Number(totalText); var freq = Number(freqText); event.value = ""; if (totalText !== "" && freqText !== "" && isFinite(total) && isFinite(freq) && freq !== 0) { var ratio = total / freq; event.value = ratio; if (ratio < 1000) { app.alert({ cMsg: "Reminder: Total divided by DropFreq is below 1,000.", cTitle: "Form Reminder", nIcon: 3, nType: 0 }); } }

4
Test and save the form

Close the field properties, preview the form, and enter values that produce a ratio below 1,000. Dismiss the alert, then use File > Save to confirm that the form can be saved. Also test a ratio of 1,000 or more and a zero or blank DropFreq.

Add a hidden calculation field with an informational alert
Check PDF viewer support: The script depends on Acrobat JavaScript. Other PDF viewers may not run it or may handle form calculations differently.
Free Microsoft Office alternative

Work with PDF forms and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and compatible Office files. You can move existing documents into WPS, but use Acrobat to create and test the JavaScript alert described above.

Open and work with PDF documents and formsCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXFamiliar interface for a smoother move from Microsoft OfficeFree, lightweight tools for everyday document work
QA img-9

Frequently Asked Questions

Will the alert prevent someone from saving the PDF?

No. This script displays an informational alert without rejecting the field values. The user must dismiss the alert before continuing to File > Save.

What happens if DropFreq is blank or zero?

The script leaves the hidden calculation field blank and does not show the reminder. It checks for a blank or zero DropFreq before dividing.

Why does the reminder appear more than once?

Acrobat can run a custom calculation whenever form fields are recalculated. If the ratio remains below 1,000, the condition can trigger another alert.

Will this alert work in every PDF viewer?

Not necessarily. The viewer must support and allow the Acrobat JavaScript used by the form. Test the completed PDF in the viewer your users will use.