PDF Editing Issues

How to Copy a Form Field Value to Read-Only Fields in PDF Forms

Adam DavisAdam Davis Oct 28, 2026 869 views

Question details

The user needs to automatically duplicate the value from an editable percentage field into three separate fields that must remain locked and read-only.

How to Copy a Form Field Value to Read-Only Fields in PDF
Product
PDF Forms
Device & OS
not provided
Scenario
Creating an interactive PDF form where a single user input needs to be displayed in multiple restricted locations without allowing the user to edit those destination fields.
Observed behavior
The destination fields need to dynamically mirror the value of the editable source field while restricting user input by remaining read-only.
Before you start

Ensure your PDF editor supports JavaScript for forms and that you have identified the exact, case-sensitive name of your editable source field before configuring the target fields.

Solution 1Recommended

Use a Custom Calculation Script for Unique Read-Only Fields

By giving each target field a unique name and applying a brief JavaScript snippet, you can dynamically mirror the source value while keeping the target fields locked.

While simply giving fields the same name will duplicate their data, this method shares all properties—meaning if one is read-only, they all become read-only. To keep one editable and the rest locked, you must use unique names combined with a calculation script.

1
Assign unique names to the target fields

Create your destination text fields and ensure each is given a unique field name to prevent property conflicts with the source field.

2
Set the target fields to Read-Only

Right-click a destination field, select 'Properties', navigate to the 'General' tab, and check the 'Read-Only' box. Repeat this for all target fields.

3
Access the calculation settings

While still in the Properties menu for a target field, navigate to the 'Calculate' tab.

4
Add the custom script

Select 'Custom calculation script' and click the 'Edit' button. Enter the following script: event.value = this.getField("SR1").valueAsString; (Replace "SR1" with the exact name of your editable source field).

5
Apply and test

Click 'OK' to save the script, then close the properties dialog. Type a value into your source field to verify that the read-only fields update automatically.

Use a Custom Calculation Script for Unique Read-Only Fields
Automatic Updates Enabled: The value will now automatically mirror in all designated read-only fields whenever the user modifies the editable source field.
Easy PDF Form Editing

Create and Manage Advanced PDF Forms with WPS Office

WPS Office offers robust PDF form creation tools, allowing you to easily add text fields, configure read-only settings, and implement custom calculation scripts.

  1. 1. Open your PDF: Launch WPS Office and open your PDF document.
  2. 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to access the interactive form creation tools.
  3. 3. Add and Configure Fields: Insert your text fields, right-click to select 'Properties', and configure the read-only settings under the General tab.
  4. 4. Apply Calculations: Use the Calculate tab in the Properties panel to add custom calculation scripts seamlessly.
Fully compatible with Adobe Acrobat PDF forms and JavaScript calculations.Intuitive drag-and-drop form builder for interactive PDFs.Comprehensive PDF toolkit including editing, converting, and document signing.Familiar user interface that makes transitioning from other software seamless.
microsoft office alternative - wps office

Frequently Asked Questions

Can I just use the exact same field name to duplicate the value?

Yes, in most PDF editors, duplicating a field and keeping the exact same name will mirror the data automatically. However, fields with the same name share all properties. If you need the destination fields to be strictly locked (read-only) while the source remains editable, you cannot use the same name. You must give them unique names and use a calculation script.

Why isn't my calculation script updating the target fields?

Ensure that the source field name referenced in your script exactly matches the actual field name, as JavaScript is case-sensitive. Additionally, verify that your PDF viewer has JavaScript execution enabled in its preferences, and ensure the calculation order is correct if you have multiple calculated fields.

Can I apply this script to checkboxes or dropdown menus?

The script 'event.value = this.getField("FieldName").valueAsString;' is primarily intended for text fields. For checkboxes or dropdowns, the logic differs because you are dealing with export values and selection states rather than simple text strings. You would need to write conditional statements to mirror checkbox states.