PDF Editing Issues

Lock PDF Form Fields Until Previous Fields Are Completed in Adobe Acrobat

Rana GarciaRana Garcia Nov 19, 2026 868 views

Question details

The user wants later PDF form fields to remain read-only until earlier fields are completed.

Lock PDF Form Fields Until Previous Fields Are Completed in Adobe Acrobat
Product
Adobe Acrobat PDF forms
Device & OS
not provided
Scenario
A form author wants to guide users through fields in a required sequence.
Observed behavior
Each subsequent field should become editable only after all preceding fields contain values.
Before you start

Open the PDF in an Acrobat version that supports editing form fields and JavaScript, and identify the exact names of the text fields in their intended order. Test the finished form in the PDF viewers your users will use, because JavaScript support varies.

Solution 1Recommended

Use an Acrobat calculation script to unlock fields in order

Use this method to make text fields editable in sequence while keeping later fields read-only.

The example checks that each preceding text field contains a nonblank value. It does not check whether a value is valid, and read-only fields are not a security control.

1
Prepare the fields

In Adobe Acrobat, open the PDF and choose Prepare a form. Create or select three text fields and name them Step1, Step2, and Step3 in their Properties dialogs.

2
Set the initial state

Open Properties for Step2 and Step3 and select Read Only on the General tab. Leave Step1 editable.

3
Add a calculation field

In Prepare a form, add another text field named SequenceControl. In its Properties, set its visibility to Hidden, then open the Calculate tab, select Custom calculation script, and click Edit.

4
Enter the script

Paste the following into the JavaScript editor and confirm the dialog: var names = ["Step1", "Step2", "Step3"]; var unlocked = true; for (var i = 0; i < names.length; i++) { var f = this.getField(names[i]); f.readonly = !unlocked; if (f.valueAsString.replace(/^\s+|\s+$/g, "") === "") unlocked = false; } event.value = ""; Replace the names in the array if your fields have different names.

5
Test the sequence

Save the PDF and use Preview in Prepare a form. Enter a value in Step1 and leave the field to check that Step2 unlocks; repeat for Step2 and Step3. Then clear an earlier field and verify that later fields become read-only again.

Use an Acrobat calculation script to unlock fields in order
Decide how to handle existing answers: This script locks later fields but does not clear their values. If a user deletes an earlier answer, later answers can remain in the form; add separate validation or clearing logic if that would make the submitted data inconsistent.
Free Microsoft Office alternative

Work with PDF Forms and Office Files in WPS Office

WPS Office is a free, lightweight alternative for working with PDFs and Office documents in a familiar interface. It can help users open and fill PDF forms, but it does not replace Acrobat's JavaScript setup for the sequential locking described here.

Open and fill supported PDF form fieldsCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar tools make it easier to move between Office documentsFree, lightweight suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

What happens if someone clears an earlier field?

The example calculation makes subsequent fields read-only again, but their existing values remain. Test this in Acrobat's Prepare a form preview and add separate clearing or validation logic if those values should not be submitted.

Does a read-only field prevent someone from changing the PDF?

No. The Read Only property guides form interaction; it is not a security measure. Use appropriate document security and server-side validation if the data must be protected or enforced.

Why might the fields stay locked in another PDF viewer?

The sequence depends on PDF JavaScript and form calculations, which some viewers do not support or may disable. Test the saved PDF in the intended viewer, including Adobe Acrobat or Acrobat Reader.

Can the script check more than three fields?

Yes. In the custom calculation script, add the exact field names to the names array in the required order. Set every field except the first to Read Only initially in its Properties dialog.