PDF Security & Access Issues

Lock PDF Form Fields After Completing a Text Field in Adobe Acrobat

Aamir Naveed AkramAamir Naveed Akram Nov 19, 2026 868 views

Question details

The user wants to make PDF form fields read-only after a text field is completed and the user confirms the form is finished.

Lock PDF Form Fields After Completing a Text Field in Adobe Acrobat
Product
Adobe Acrobat and Adobe Acrobat Reader
Device & OS
not provided
Scenario
A PDF form contains entered values that should no longer be edited after the user confirms completion.
Observed behavior
The desired result is to lock regular form fields while leaving buttons and signature fields available.
Before you start

Open the PDF in Adobe Acrobat and identify the exact name of the text field that must be completed. JavaScript must be enabled in the PDF viewer for the button action to run.

Solution 1Recommended

Add a confirmation button that locks completed PDF form fields

Use a button and an Acrobat JavaScript action to check a required text field and make non-button, non-signature fields read-only.

This method marks fields as read-only rather than flattening the PDF. It helps prevent accidental changes but is not a security guarantee against someone who can modify the form.

1
Open the form editor

In Adobe Acrobat, open the PDF and select Prepare a form. Check the required text field's name in its properties.

2
Create a button

In Prepare a form, add a button to the page, give it a name, and open its Properties. Set a label such as Finalize Form.

3
Add the JavaScript action

In Button Properties, open Actions. Set Select Trigger to Mouse Up and Select Action to Run a JavaScript, then click Add. Paste the following script and replace CompletionText with the exact name of your required text field: var required = this.getField("CompletionText"); if (!required || /^\s*$/.test(required.valueAsString)) { app.alert("Complete the required text field before finalizing the form."); } else if (app.alert("Finalize the form and make its fields read-only?", 2, 2) === 4) { for (var i = 0; i < this.numFields; i++) { var field = this.getField(this.getNthFieldName(i)); if (field && field.type !== "button" && field.type !== "signature") { field.readonly = true; } } }

4
Save and test the form

Close Button Properties and save the PDF. Open it in Acrobat or Reader, complete the required field, click Finalize Form, and confirm. Check that regular fields are read-only and that buttons and signature fields remain available, then save the completed PDF.

Add a confirmation button that locks completed PDF form fields
Viewer support matters: The button depends on Acrobat JavaScript support and viewer settings. Test the form in the intended version of Acrobat or Reader; other PDF viewers may not run the script or preserve its effects.
Free Microsoft Office alternative

Work with PDF and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDF and Office files. Its Microsoft Office format compatibility helps with migration, but it does not replace the Acrobat JavaScript setup described above.

Open and work with PDF files alongside office documentsCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar interface for an easier transition from Microsoft OfficeFree, lightweight suite for everyday document tasks
microsoft office alternative - wps office

Frequently Asked Questions

Can the form lock fields automatically when text is entered?

A field event can trigger JavaScript, but the button method lets the user confirm that the entire form is complete before the fields become read-only.

Why are button and signature fields excluded?

The script checks each field's type and skips buttons and signature fields so users can still use buttons or apply a signature after finalizing the other fields.

Will the button work in every PDF viewer?

No. The action requires support for Acrobat JavaScript and may be affected by viewer settings. Test it in the Acrobat or Reader version your users will use.

Does making fields read-only securely protect the form?

No. Read-only fields help prevent accidental editing, but someone with suitable tools or permissions may be able to change them. Consider a digital signature or other appropriate PDF security controls when stronger protection is needed.