Transfer Data Between PDF Form Fields with Acrobat JavaScript
Question details
The user wants to open a second PDF form from a button and return entered data to the first form.

- Product
- Adobe Acrobat PDF forms
- Device & OS
- not provided
- Scenario
- A user is designing two PDF form sections that need to share entered values.
- Observed behavior
- Cross-document communication can be restricted or unreliable under Acrobat security rules.
Check that both PDFs are editable forms and identify the field names whose values you want to transfer. You will need a PDF editor that can create form fields and add Acrobat JavaScript actions.
Combine the Form Sections and Copy Values Within One PDF
Use a single PDF when you need a more dependable way to transfer values between form sections.
Acrobat security restrictions can prevent or limit communication between separate PDF documents. Keeping the fields in one document lets a button script access them through the current document.
In Adobe Acrobat, open Combine Files, add both PDFs, arrange their pages, and select Combine. Alternatively, place both form sections in one PDF before creating the fields.
Open Prepare a Form and verify that the combined PDF contains the required fields. Give the source and destination fields distinct names, such as Section2_Name and Section1_Name, and recreate any fields that did not carry over.
In Prepare a Form, add or select a button in the second section and open its Properties. On the Actions tab, choose Mouse Up and Run a JavaScript, then select Add.
In the JavaScript editor, enter: var source = this.getField("Section2_Name"); var target = this.getField("Section1_Name"); if (source && target) { target.value = source.value; } else { app.alert("Check the form field names."); } Replace the example names with your actual field names, then save the action and PDF.
Close form editing, enter a value in the source field, and click the transfer button. Return to the first section and check that the destination field contains the value.

Work with PDFs and Office Documents in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. Its format compatibility helps you move existing files into your workflow; it is not a fix for Acrobat cross-document JavaScript restrictions.

Frequently Asked Questions
Why not send the data directly between two open PDFs?
Acrobat security rules can restrict cross-document access, making the approach unreliable. Putting both sections in one PDF allows a button script to address fields in the current document instead.
How do I find the names used in the JavaScript?
In Acrobat, open Prepare a Form and select each field to inspect its properties. Use the exact source and destination field names in the getField calls.
Can I transfer more than one field?
Yes. In the button's Run a JavaScript action, add a source and destination lookup for each pair of fields, then assign each source value to its corresponding destination.
Why does the button work in Acrobat but not another PDF viewer?
PDF viewers differ in their support for Acrobat JavaScript and security settings. Test the saved form in the viewer where it will be used and check whether JavaScript is allowed.




