PDF Editing Issues

Transfer Data Between PDF Form Fields with Acrobat JavaScript

Amos GikundaAmos Gikunda Nov 18, 2026 869 views

Question details

The user wants to open a second PDF form from a button and return entered data to the first form.

Transfer Data Between PDF Form Fields with Acrobat JavaScript
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.
Before you start

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.

Solution 1Recommended

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.

1
Combine the PDFs

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.

2
Check the form 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.

3
Add a transfer button

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.

4
Enter the field script

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.

5
Test the transfer

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.

Combine the Form Sections and Copy Values Within One PDF
Check viewer support: The script requires a PDF viewer that supports Acrobat JavaScript and permits it to run. Combining files may not preserve every existing form field or action, so verify them in Prepare a Form.
Free Microsoft Office alternative

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.

Open PDFs alongside your other documentsCompatible with Microsoft Office formats, including DOCX, XLSX, and PPTXUse a familiar interface for an easier transitionKeep common document tools together in a lightweight suite
microsoft office alternative - wps office

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.