How to Duplicate a PDF Form Field and Make It Read-Only
Question details
The user wants to display the value of one PDF form field in a second field, but requires the second field to remain non-editable (read-only).

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Designing an interactive PDF form where user input needs to be automatically mirrored in another section without allowing manual edits to the duplicated value.
- Observed behavior
- Requires a method to automatically copy data from a source text field to a distinct, read-only destination field upon form update.
Ensure you have access to a PDF editor with form building and JavaScript capabilities. Identify the exact field name of your source text box before writing the script.
Use a Custom JavaScript Calculation
Create a distinct second field, apply a calculation script to fetch the first field's value, and lock the destination field as read-only.
By assigning distinct names to the source and destination fields, you can manage their properties independently. Using a calculation script ensures the destination updates automatically whenever the source is modified.
Add two separate text fields to your PDF document. Give them distinct names, such as "FIELD1" for the source and "FIELD2" for the destination.
Right-click the second field ("FIELD2") and select Properties. Navigate to the Calculate tab.
Choose 'Custom calculation script' and click Edit. Enter the following JavaScript code: event.target.value = this.getField("FIELD1").value; and click OK.
Switch to the General tab in the Properties window of the second field and check the 'Read Only' box. Close the properties dialog and test the form.

Use Identical Field Names (Editable Copies)
Assigning the exact same name to multiple form fields automatically duplicates user input across all of them.
Create and Manage Advanced PDF Forms with WPS Office
WPS Office provides a comprehensive PDF toolkit, allowing you to easily design interactive forms, manage text fields, and ensure full compatibility with standard PDF viewers.
- 1. Open your PDF in WPS Office: Launch WPS Office and open your PDF document. Switch to the 'Form' tab on the top ribbon to access form tools.
- 2. Insert Form Fields: Click 'Text Field' to insert the required fields into your document. Double-click the newly created field to open its properties menu.
- 3. Configure Field Settings: In the properties dialog, you can adjust the field name, set it to read-only, and manage interactive properties to ensure your form functions perfectly.

Frequently Asked Questions
Why is my JavaScript calculation not updating the field?
Form fields typically update when focus is lost or a calculate event is triggered. Ensure the field name in your script exactly matches the source field's name, including capitalization, as JavaScript is strictly case-sensitive.
Can I make duplicate named fields read-only?
If fields share the exact same name, they share the same properties. Making one read-only will typically make all instances of that field read-only. To have one editable and one read-only, you must use distinct names and a calculation script.
How do I hide the duplicated field instead of making it read-only?
Open the field properties of the destination field, navigate to the General tab, and change the Form Field property from 'Visible' to 'Hidden'. The calculation script will still run and store the value without displaying it on the printed or viewed page.




