PDF Editing Issues

Lock Completed PDF Form Fields Before Email Submission in Adobe Acrobat

Aamir Naveed AkramAamir Naveed Akram Nov 19, 2026 868 views

Question details

The user wants to lock completed PDF form fields while leaving blank fields editable before emailing the form.

Lock Completed PDF Form Fields Before Email Submission in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form is submitted by email after some fields have been completed and others remain blank.
Observed behavior
Completed fields should become read-only, while blank fields remain available for the recipient to fill in.
Before you start

Open the fillable PDF in Adobe Acrobat and check that you can edit its form fields and submit button in Prepare a form. Make sure Acrobat JavaScript is enabled under Preferences > JavaScript, and identify how the form will be emailed.

Solution 1Recommended

Add a JavaScript action before the submit action

Use a button action to mark nonblank fields as read-only immediately before submission.

This example skips buttons and signature fields. It treats whitespace-only values and unchecked checkboxes or radio buttons as blank; prefilled values are treated as completed.

Read-only fields are not a security barrier. A recipient with suitable PDF editing tools may be able to change their properties.

1
Open the button properties

In Acrobat, open All tools > Prepare a form, then right-click the submit button and choose Properties.

2
Add the locking script

On the Actions tab, select Mouse Up as the trigger and Run a JavaScript as the action, then click Add. Enter this script and confirm: for (var i = 0; i < this.numFields; i++) { var f = this.getField(this.getNthFieldName(i)); if (!f || f.type == "button" || f.type == "signature") continue; var value = f.valueAsString; if ((f.type == "checkbox" || f.type == "radiobutton") && value == "Off") continue; if (value.replace(/^\s+|\s+$/g, "") != "") f.readonly = true; }

3
Check the submission action

On the Actions tab, ensure the JavaScript action appears before the existing Submit a form action for Mouse Up. Use the Up or Down controls to change the order if needed. If there is no submission action, add one and configure its destination and format.

4
Test the emailed form

Close the properties dialog, fill in some fields, leave others blank, and click the submit button. Open the resulting emailed PDF and check that completed fields are read-only and blank fields remain editable.

Add a JavaScript action before the submit action
Check the submission format: Submitting only form data does not necessarily send the PDF or its updated field properties. Use a workflow that sends the updated PDF itself, and test it with your Acrobat version, email client, and recipient's PDF viewer. Email submission support can vary.
Free Microsoft Office alternative

Review PDF Forms and Office Files with WPS Office

WPS Office is a free, lightweight alternative for everyday document and PDF work, with a familiar interface and compatibility that helps you move existing Office files. It does not configure or guarantee execution of Acrobat's form-submission JavaScript.

Open and review PDF forms alongside other documentsCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface for everyday office tasksMove existing Office files into a lightweight suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the JavaScript need to run before the submit action?

The script must set field properties before submission. In the button's Properties > Actions tab, place Run a JavaScript above Submit a form for the same Mouse Up trigger.

Will a field containing its default value be locked?

Yes, if that value is nonblank. The example checks whether a field contains data rather than whether its value differs from its default.

Are unchecked checkboxes left editable?

Yes. The example skips checkboxes and radio buttons whose value is Off, so they remain editable unless another setting already makes them read-only.

Why are the fields still editable in the email recipient's copy?

Check whether the workflow sent the updated PDF itself rather than only form data. Test the submitted PDF in the recipient's viewer, and confirm that the JavaScript action ran before submission.

Can recipients change fields that were made read-only?

Read-only is a form field property, not tamper-proof protection. Someone with suitable PDF editing tools may be able to modify it.