How to Link Duplicate Fields and Combine Names in PDF Forms
Question details
The user needs to synchronize duplicate form fields (such as ID numbers) so data is shared automatically, and combine separate first-name and last-name input fields into a single full-name field within a PDF form.

- Product
- PDF Form Editors
- Device & OS
- not provided
- Scenario
- Creating or merging interactive PDF forms where users need to fill out repetitive personal information efficiently.
- Observed behavior
- Currently, duplicate fields require manual, repetitive data entry from the user, and full names cannot be automatically generated from separate first and last name input boxes.
Ensure you have access to a robust PDF editor with form creation and custom JavaScript calculation capabilities, and that your document is opened in form-editing mode.
Use Identical Field Names and a Calculation Script
Give duplicate fields the exact same name to sync their data, and use a custom JavaScript calculation to merge the first and last name fields.
By assigning the exact same Name property to multiple form fields, your PDF editor will automatically synchronize the data entered across all instances. For combining fields, a simple Custom Calculation Script will dynamically merge the text strings.
Open your PDF editor's form preparation tool. Right-click the duplicate fields (e.g., ID numbers), select 'Properties', and ensure both have the exact same 'Name' value. Data entered in one will now populate the other.
Add a new text field where you want the combined name to appear and name it 'FullName'. Double-click it to open the Properties menu.
Navigate to the 'Calculate' tab in the Properties menu. Select 'Custom calculation script' and click the 'Edit' button.
Enter the following script: event.value = this.getField('FirstName').value + ' ' + this.getField('LastName').value; (Ensure 'FirstName' and 'LastName' match your actual field names exactly), then click 'OK'.
Go to the 'General' tab in the 'FullName' field properties and check the 'Read Only' box so users cannot manually overwrite the automatically calculated result.

Create and Manage PDF Forms with WPS PDF
WPS Office provides a comprehensive PDF editor that lets you quickly insert interactive form fields, manage field properties, and streamline data collection without a steep learning curve.
- 1. Open your document: Launch WPS Office and open your PDF document. Navigate to the 'Form' tab on the top ribbon.
- 2. Insert form fields: Select 'Text Field' from the toolbar and click and drag on the document to draw new input boxes for your users.
- 3. Adjust properties: Double-click any newly created text field to open the 'Properties' panel on the right side of the screen.
- 4. Sync duplicate fields: Give fields identical names in the Properties panel if you want them to duplicate user input automatically across the document.
- 5. Save and distribute: Save your interactive PDF form. The synchronized fields will function correctly in any standard PDF reader.

Frequently Asked Questions
Why aren't my duplicate PDF form fields synchronizing?
Fields will only synchronize if their 'Name' properties are exactly identical, including capitalization and spaces. Check the properties of both fields to ensure they match perfectly.
Can I hide the calculated full-name field if the user hasn't typed anything yet?
Yes, you can modify your JavaScript calculation script with a simple 'if' statement to check if the first and last name fields are empty. This prevents the field from showing just a blank space before data is entered.
Will these calculation scripts work in any PDF viewer?
Basic text fields and duplicated field names work in almost all standard PDF viewers. However, JavaScript calculations for concatenating names may not trigger in simple browser-based PDF viewers or basic mobile apps.
Can users manually edit a calculated field if they need to change it?
By default, yes, calculated fields can be edited manually. To prevent users from accidentally overwriting the automated full name, you must open the field's General properties and check the 'Read Only' option.




