Create an Acrobat JavaScript Button to Move PDF Form Fields
Question details
Create an UP button that uses JavaScript to move a signature or form field in a PDF.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- The user wants a PDF form button to reposition a specified field when clicked.
- Observed behavior
- Clicking the button should move the target field upward by a defined distance.
Open the PDF in a version of Acrobat that supports form editing and document JavaScript. Check the exact name of the field you want to move in Prepare a form, and make sure JavaScript is enabled for testing.
Call a Document-Level Function from the UP Button
Use this approach to move a named form or signature field upward whenever the button is clicked.
The function changes the field rectangle's vertical coordinates. The example moves the field by 10 PDF points per click; change that value to adjust the distance.
In Acrobat, open All tools > Use JavaScript > Document JavaScripts. In some versions, use Tools > JavaScript > Document JavaScripts. Add a script named MoveUp and enter: function moveFieldUp(fieldName) { var f = this.getField(fieldName); if (!f) { app.alert('Field not found: ' + fieldName); return; } var r = f.rect; r[1] += 10; r[3] += 10; f.rect = r; }
Open All tools > Prepare a form, add a Button field if needed, and name it UP. Open the button's Properties and set its visible label to UP.
In the button Properties dialog, open Actions. Select Mouse Up as the trigger and Run a JavaScript as the action, then click Add. Enter moveFieldUp('Signature1');, replacing Signature1 with the exact name of your target field.
Close the Properties dialog, exit form editing or use Preview, and click UP. Confirm that the intended field moves upward, then save the PDF.

Work with PDFs and Office Documents in WPS Office
WPS Office is a free, lightweight alternative for everyday document and PDF work. Its familiar interface and Microsoft Office format support make it easy to bring existing files into your workflow. Use Acrobat for the JavaScript-driven field movement described above.

Frequently Asked Questions
How do I find the name of the field I want to move?
In Acrobat, open Prepare a form and select the field. Check its name in the field list or in the field's Properties, then use that exact name in the button's JavaScript.
Can the same function move different fields?
Yes. Call moveFieldUp with a different field name for each button, such as moveFieldUp('Text1'); or moveFieldUp('Signature1');.
How can I change how far the field moves?
In Document JavaScripts, edit the MoveUp function and change both instances of 10 to the same desired distance in PDF points. Positive values move the field upward.
Why doesn't the button work in my PDF viewer?
The viewer may not support Acrobat JavaScript, or JavaScript may be disabled. Test the saved PDF in Acrobat with JavaScript enabled, and check that the target field name matches exactly.




