How to Create a PDF Form with a Button That Auto-Populates Fields
Question details
The user wants to build an interactive PDF featuring fillable fields and a clickable button that uses JavaScript to automatically transfer or duplicate entered data to other specific areas within the document before printing.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an automated interactive PDF form to streamline data entry and ensure accurate printing.
- Observed behavior
- Requires a workflow to design the initial layout, insert interactive text fields, and program a button to push data from one field to another.
Before adding interactive elements, finalize your document's basic layout using a word processor or page layout software, as PDF editors are designed to make existing documents interactive rather than building layouts from scratch.
Design the Layout in an Authoring App and Add Interactivity via Acrobat
First, create your base document in an application like Word or InDesign, convert it to PDF, and then use Adobe Acrobat to add form fields and JavaScript actions to your buttons.
Acrobat is not ideally used to create documents from scratch. The most efficient workflow is to design the visual structure in a dedicated authoring tool and then handle the interactivity in a PDF editor.
Open a program like Microsoft Word, Adobe InDesign, or WPS Writer to create the visual layout of your document, leaving clear blank spaces where the form fields will eventually be placed.
Save or export your finished layout as a PDF file to prepare it for interactivity.
Open the exported PDF in Adobe Acrobat, navigate to the 'Prepare Form' tool from the right-hand pane, and insert text fields for both user input and the destination areas where data should be duplicated.
Add a Button field from the form tools. Right-click the newly created button, select 'Properties', and navigate to the 'Actions' tab. Select 'Run a JavaScript' as the action trigger.
Click 'Add' to open the JavaScript editor. Write a simple script to copy the value from the source field to the destination field (e.g., this.getField("DestinationField").value = this.getField("SourceField").value;) and save your PDF.

Build Fillable PDF Forms Easily with WPS Office
WPS Office features a comprehensive PDF editor that lets you easily convert Word documents into fillable PDFs, add text fields, checkboxes, and interactive controls seamlessly.
- 1. Create your layout in WPS Writer: Open WPS Writer, design your document layout with spaces for input, and export it as a PDF document.
- 2. Open the file in WPS PDF: Switch to the WPS PDF tab and open the newly created PDF file.
- 3. Access the Form Tools: Click on the 'Form' tab in the top ribbon menu to access the interactive form controls.
- 4. Add your interactive fields: Select 'Text Field', 'Checkbox', or 'Push Button' and drag them onto your document layout to create the interactive areas.

Frequently Asked Questions
Can I create a PDF form completely from scratch within a PDF editor?
While you can add blank pages and text in most PDF editors, it is highly recommended to design the visual layout in a word processor like Word or InDesign first, then convert it to PDF to add the interactive form fields.
Do I need to know programming to make a button populate PDF fields?
Yes, you will need a basic understanding of JavaScript to write the script that pulls the value from the source text field and applies it to the destination field when the button is clicked.
Will the JavaScript in my PDF form work on all PDF viewers?
Not always. While major software like Adobe Acrobat and comprehensive PDF editors support JavaScript in forms, some lightweight browser-based PDF viewers or mobile apps may not execute the scripts correctly.
How do I duplicate text across a PDF form without using a button?
You can assign the exact same field name to multiple text fields in the PDF editor. When a user types information into one, it will automatically mirror the data in all other fields with that identical name without needing any JavaScript or buttons.




