How to Make Fields Read-Only After Signing a Spawned Acrobat Template
Question details
The user needs a method to automatically lock specific form fields (make them read-only) after a signature is applied to a newly spawned PDF template page.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Using spawned templates in a PDF where standard signature locking mechanisms fail due to dynamically generated field names.
- Observed behavior
- The signature field successfully locks designated fields on the original template, but fails to lock the corresponding fields on spawned pages because Acrobat changes their names dynamically.
Ensure you have access to the JavaScript editing features in your PDF editor, and make sure to save a backup copy of your original fillable template before applying custom scripts.
Use Acrobat JavaScript to Dynamically Lock Spawned Fields
Apply a custom JavaScript action to dynamically identify and lock the dynamically renamed form fields based on their new template page prefixes.
When a template is spawned in Adobe Acrobat, the new form fields are automatically renamed to prevent conflicts. They are assigned a prefix that includes the template name and the page index (for example, 'P1.TemplateName.FieldName'). Because of this dynamic renaming, standard signature locks that look for the original field names will fail.
To fix this, you need to use Acrobat JavaScript to construct the correct dynamic field names or loop through all fields on the document to set their 'readonly' property to true immediately after signing.
Spawn a test page from your template and use the Prepare Form tool to inspect the generated field names. Note the exact prefix structure applied to the new fields.
Right-click the signature field on your original template and select 'Properties'. Navigate to the 'Actions' tab, select a trigger such as 'Mouse Up' or link it directly to the signing action, and choose 'Run a JavaScript'.
Enter a script that dynamically calculates the current page prefix and loops through the desired fields. Use a command like 'this.getField("P" + pageNum + ".Template.FieldName").readonly = true;' to lock them.
Save your script, spawn a new page from the template, and apply a test signature. Verify that the correct dynamically named fields become read-only upon signing.

Easily Sign and Secure PDFs with WPS Office
Instead of relying on complex custom JavaScript and spawned templates, you can use WPS Office's intuitive PDF tools to quickly add signatures and flatten the document, ensuring all form fields immediately become read-only and tamper-proof.
- 1. Open Your PDF Form: Launch WPS Office and open the fillable PDF form you need to complete.
- 2. Fill and Sign the Document: Navigate to the 'Fill & Sign' tab on the top ribbon, fill in the necessary text fields, and securely insert your signature.
- 3. Flatten the Document: To make all fields read-only, go to the 'Protect' or 'Export' menu and select the option to flatten the PDF document.
- 4. Save the Secured File: Save the newly flattened PDF. All interactive form fields and signatures are now permanently locked.

Frequently Asked Questions
Why do my signature fields lock on the original template but fail on spawned pages?
When a template is spawned, the PDF software automatically changes the names of the form fields to include a page prefix (e.g., P1.TemplateName). Since the names change dynamically, standard signature lock properties that target the original names no longer recognize the new fields.
Can I lock spawned fields without writing custom JavaScript?
Generally, no. Because the spawned field names are dynamically generated upon creation, standard locking features cannot predict their names. Custom document-level JavaScript is required to identify the new field names and programmatically change their read-only properties.
Is it a bad practice to put a signature field directly on a spawned template?
It can be problematic because spawning multiple pages with signature fields creates a multiple-signature document structure. This can bloat the file size, complicate document validation, and potentially invalidate prior signatures. Flattening pages is often a safer alternative.




