PDF Editing Issues

Use an Acrobat JavaScript Button to Decrease a PDF Field Value

Rana GarciaRana Garcia Nov 19, 2026 869 views

Question details

Add a button action that decreases the FunCurr PDF form field by one each time the button is pressed.

Use an Acrobat JavaScript Button to Decrease a PDF Field Value
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form contains a button and a numeric field named FunCurr.
Observed behavior
Each button press should reduce the value in FunCurr by one.
Before you start

Open the PDF in a version of Adobe Acrobat that can edit form fields. Confirm that the target field is named FunCurr and contains a numeric starting value.

Solution 1Recommended

Add a Mouse Up JavaScript action to the Acrobat form button

Use this action to subtract one from FunCurr whenever the button is clicked.

1
Open the form editor

In Adobe Acrobat, open the PDF and select Prepare a form from the Tools or All tools menu.

2
Open button properties

Right-click the form button and choose Properties, then select the Actions tab.

3
Add the script

Set the trigger to Mouse Up and the action to Run a JavaScript. Click Add, enter this.getField("FunCurr").value -= 1; and confirm the script.

4
Test the button

Close the Properties dialog, select Preview in the form editor, and click the button. Check that FunCurr decreases by one on each click, then save the PDF.

Add a Mouse Up JavaScript action to the Acrobat form button
Check JavaScript support: The action requires a PDF viewer that supports Acrobat form JavaScript and has JavaScript enabled. Some browser PDF viewers may not run it.
Free Microsoft Office alternative

Use WPS Office for everyday document and PDF work

WPS Office is a free, lightweight alternative for everyday document work, with a familiar interface and compatibility with common Microsoft Office formats for easier migration. Use Adobe Acrobat to configure the JavaScript button described above; WPS Office is not a replacement for that Acrobat form action workflow.

Open PDFs alongside your other office documentsWork with Microsoft Word, Excel, and PowerPoint formatsNavigate documents with a familiar, easy-to-use interfaceUse a free, lightweight office suite for everyday tasks
microsoft office alternative - wps office

Frequently Asked Questions

Where should I put the decrement script?

In Acrobat's Prepare a form tool, open the button's Properties, select Actions, and add the script as a Run a JavaScript action with the Mouse Up trigger.

Does the field name have to be FunCurr?

The name in this.getField("FunCurr") must match the target form field's name. If your field has a different name, replace FunCurr in the script with that name.

What value should the field contain before I click the button?

Enter a numeric starting value in FunCurr, such as 10. Each click will subtract one from that value.

Why does the button work in Acrobat but not in my browser?

Some browser PDF viewers do not support Acrobat form JavaScript. Open the saved PDF in Acrobat or another viewer that supports the action and check that JavaScript is enabled.