PDF Editing Issues

How to Duplicate a PDF Form Field and Make It Read-Only

Kushani NimanthikaKushani Nimanthika Nov 3, 2026 869 views

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).

How to Duplicate a PDF Form Field and Make It 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.
Before you start

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.

Solution 1Recommended

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.

1
Create both form fields

Add two separate text fields to your PDF document. Give them distinct names, such as "FIELD1" for the source and "FIELD2" for the destination.

2
Access the destination field properties

Right-click the second field ("FIELD2") and select Properties. Navigate to the Calculate tab.

3
Add the calculation script

Choose 'Custom calculation script' and click Edit. Enter the following JavaScript code: event.target.value = this.getField("FIELD1").value; and click OK.

4
Set the field to read-only

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 a Custom JavaScript Calculation
Script Tip: Make sure to replace "FIELD1" in the script with the exact name of your source field. JavaScript is case-sensitive, so exact capitalization is required.

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. 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. 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. 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.
Easily insert and configure PDF text fields, checkboxes, and buttons.Fully compatible with standard Adobe PDF forms and JavaScript logic.Lightweight software with a user-friendly interface for effortless document management.Free to use for basic PDF reading, annotating, and editing tasks.
microsoft office alternative - wps office

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.