Lock Completed PDF Form Fields Before Email Submission in Adobe Acrobat
Question details
The user wants to lock completed PDF form fields while leaving blank fields editable before emailing the form.

- 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.
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.
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.
In Acrobat, open All tools > Prepare a form, then right-click the submit button and choose Properties.
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; }
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.
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.

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.

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.




