How to Copy and Paste Data Between Rows in Fillable PDF Forms
Question details
The user needs to programmatically duplicate data or field values from one table row to another within a fillable PDF document.

- Product
- Device & OS
- not provided
- Scenario
- Streamlining data entry in a fillable PDF form with tabular data by automating the transfer of values across rows, reducing repetitive manual typing.
- Observed behavior
- Looking for a scripted or automated method to cleanly duplicate values between predefined fields using field events.
Verify the exact names of the source and target fields in your fillable PDF form, as the script relies on these exact identifiers to function correctly.
Use a JavaScript Action to Duplicate Field Values
Execute a custom JavaScript command triggered by a button click or field event to automatically copy the value from the source field to the target field.
PDF forms support programmatic actions through JavaScript. By assigning a short script to a button's 'Mouse Up' trigger or a specific field's 'Calculate' event, you can instantly fetch a value from one field and apply it to another.
Open your PDF in form editing mode. Right-click the field you want to copy from, select 'Properties', and note its exact 'Name' in the General tab. Repeat this process for the target field.
Right-click the button or field that will trigger the copy action and open 'Properties'. Navigate to the 'Actions' tab. Choose an appropriate trigger, such as 'Mouse Up' for a button or 'On Blur' for a text field.
In the 'Select Action' dropdown, choose 'Run a JavaScript' and click 'Add'. In the JavaScript Editor window, type the following command: this.getField('TargetField').value = this.getField('SourceField').valueAsString;
Click 'OK' to save the script, then close the properties window. Switch back to the standard hand tool or preview mode, enter data into your source field, and activate your trigger to ensure the data copies over.
Manage and Fill PDF Forms Easily with WPS PDF
WPS Office includes a robust PDF editor equipped to handle interactive fillable forms. It allows you to seamlessly read, fill, and manage PDF documents without needing heavy, expensive software.
- 1. Download and Install: Get WPS Office for free from the official website and complete the quick installation process.
- 2. Open Your PDF Form: Launch WPS Office and drag your fillable PDF document directly into the application workspace.
- 3. Fill and Manage Data: Interact with text fields, checkboxes, and buttons natively. Once your data is entered, save or export the filled PDF.

Frequently Asked Questions
How do I find the specific name of a field in my PDF form?
Enter the form editing mode of your PDF software, right-click the field in question, and select 'Properties'. The field name will be prominently displayed at the top of the General tab.
Will this JavaScript action work if the PDF is opened in a web browser?
Not always. While dedicated desktop PDF editors support JavaScript execution, many built-in web browser PDF viewers restrict or block custom scripts for security reasons. Users should open the form in a proper PDF client.
Can I copy data across multiple rows at the same time?
Yes. You can add multiple lines of the same JavaScript command to your single trigger action. Simply create a new line for each target and source pair, ensuring the unique field names are updated for each row.




