PDF Editing Issues

Fix Acrobat JavaScript Reading an Old PDF Form Field Value

Olivia MillerOlivia Miller Nov 19, 2026 869 views

Question details

The user needs an Acrobat form button to read the latest text field value before emailing the PDF.

Fix Acrobat JavaScript Reading an Old PDF Form Field Value
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A user edits the final text field and immediately clicks a button that runs JavaScript to email the PDF.
Observed behavior
The button script may read the field's previous value because the latest entry has not yet been committed.
Before you start

Open the PDF in Acrobat and make sure you can edit its form fields. Identify the email button and the text field whose latest value is being missed.

Solution 1Recommended

Move the email button script to the Mouse Up event

Use Mouse Up instead of Mouse Down so Acrobat can commit the latest field entry before the email script runs.

1
Open the form editor

In Acrobat, open the PDF and select Prepare a Form from the tools.

2
Inspect the button action

Double-click the email button, open the Actions tab, and check whether the JavaScript action is assigned to the Mouse Down trigger.

3
Move the script

Select the Mouse Down JavaScript action and click Edit. Copy the script, close the editor, and remove that action. Select Mouse Up as the trigger, choose Run a JavaScript as the action, click Add, and paste the script.

4
Save and test the form

Close the button properties, save the PDF, and exit form editing. Change the last text field and immediately click the email button; check that the script uses the new value.

Move the email button script to the Mouse Up event
If the value is still old: Check the field's validation or calculation scripts and confirm that the button reads the intended field. Email behavior can also depend on Acrobat settings and the available email application.
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. It supports common Microsoft Office formats for easier migration, but it does not change Acrobat's JavaScript event behavior.

Open and review PDF documents alongside office filesCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface to move between documents and PDFsGet a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does my button read the previous text field value?

A script assigned to Mouse Down may run before Acrobat commits the latest text entry. Check the button's Actions tab and move the JavaScript to Mouse Up.

Where can I find the button's JavaScript?

Open Prepare a Form in Acrobat, double-click the button, and select the Actions tab. Select the JavaScript action and click Edit to view its code.

Do I need to change the mailDoc() code?

Not necessarily. If the script is assigned to Mouse Down, first move the existing script to Mouse Up and test it after editing the last field.

What should I check if Mouse Up does not fix the value?

Confirm that the script references the correct field, then inspect that field's validation and calculation scripts in its properties. Test again after saving the form.