How to Let Users Edit Automatically Populated PDF Form Fields
Question details
The user needs to configure a PDF form so that entering data into a source field automatically populates a destination field, while still allowing the destination field to be manually edited independently.

- Product
- PDF Forms
- Device & OS
- not provided
- Scenario
- Designing interactive PDF forms where certain repetitive fields are auto-filled to save time, but might require manual correction or adjustment by the end-user.
- Observed behavior
- When form fields share the exact same name, they mirror each other permanently and cannot be edited independently. A custom solution is required to unlink them while retaining the auto-fill capability.
Ensure you are using a comprehensive PDF editor like WPS Office or Adobe Acrobat Pro that supports inserting custom JavaScript for form field validation.
Use a Custom Validation Script for Uniquely Named Fields
By assigning unique names to the source and destination fields and applying a short custom validation script, you can push the initial data to the destination field without locking it from future manual edits.
By default, PDF forms automatically mirror data across fields that share the exact same name. To allow independent editing, the fields must have different names, and a script must be used to transfer the data.
Open your PDF form editor. Locate the source field and the destination field. Ensure they have completely unique names (for example, name the source field 'Name' and the destination field 'Name_Copy').
Right-click the source field ('Name') and select 'Properties' from the context menu.
In the Properties window, click on the 'Validate' tab to access custom script options.
Select the option to 'Run custom validation script' and click the 'Edit' button. Enter the following JavaScript code: this.getField("Name_Copy").value = event.value; (ensure you replace 'Name_Copy' with the actual name of your destination field). Click 'OK' to save.

Create and Manage Interactive PDF Forms with WPS Office
WPS Office provides a comprehensive suite of PDF tools, allowing you to easily create, fill, and configure interactive PDF forms. With full support for form field properties and advanced JavaScript integration, handling complex form logic is straightforward and efficient.
- 1. Open your PDF document: Launch WPS Office and open the PDF file you wish to convert into an interactive form.
- 2. Navigate to the Form tab: Click on the 'Form' tab in the top ribbon to access the complete set of form creation tools.
- 3. Insert and configure fields: Add text fields, checkboxes, and buttons. Right-click any field to access its properties and set up validation scripts.
- 4. Save your interactive form: Once your fields and scripts are configured, save the PDF to share a fully interactive, fillable document.

Frequently Asked Questions
Why do PDF fields with the same name automatically mirror each other?
According to standard PDF specifications, form fields that share the exact same name are treated as a single data point. When a user enters text into one, it automatically replicates to all identically named fields, which locks them together and prevents independent editing.
Do users need a paid PDF editor to fill out forms with custom scripts?
No, end-users only need a standard free PDF reader, such as WPS PDF or Adobe Acrobat Reader, to fill out the form. The custom validation scripts will execute automatically in the background within the free reader.
Can I use this custom validation script for dropdown menus?
Yes, custom validation scripts can be applied to various form field types, including dropdowns and combo boxes, as long as the script correctly references the destination field name and passes a valid value.
What should I do if the script doesn't execute when testing the form?
Ensure that JavaScript is enabled in your PDF reader's preferences. Some security configurations disable JavaScript by default, which prevents custom validation scripts from running when the form is filled.




