Other PDF Issues

How to Prevent an Acrobat PDF Form from Locking if Email Submission is Canceled

Emma BrownEmma Brown Oct 28, 2026 869 views

Question details

The user needs to stop a fillable PDF form from permanently locking its fields when an email submission process is initiated but subsequently canceled.

How to Prevent an Acrobat PDF Form from Locking Before Email Submission Is Canceled
Product
Adobe Acrobat Fillable PDF
Device & OS
not provided
Scenario
Submitting a fillable PDF form via a custom 'Email and Save As' button that utilizes a locking script.
Observed behavior
The form fields lock immediately when the submit button is clicked. If the user cancels the email action, the form remains locked and no further corrections can be made.
Before you start

Before modifying your form scripts, ensure you have a backup copy of the original fillable PDF and access to Adobe Acrobat Pro or a compatible PDF editor with JavaScript support.

Solution 1Recommended

Adjust Script Execution to Lock Fields After Submission

Modify the JavaScript attached to your submit button so that the form locking mechanism is triggered only after the email or save operation completes.

Because Adobe Acrobat JavaScript does not reliably provide a cancellation callback for email commands, placing the locking script before the email command guarantees the form will lock regardless of the email's success.

To resolve this, you must change the execution order so that the form submits first. Note that even with this change, testing is required as Acrobat's behavior can vary between versions.

1
Open Prepare Form mode

Open your PDF document in Adobe Acrobat Pro and select the 'Prepare Form' tool from the right-hand pane.

2
Access Button Properties

Right-click the 'Email/Submit' button on your form and choose 'Properties' from the context menu.

3
Edit JavaScript Actions

Navigate to the 'Actions' tab, select the 'Run a JavaScript' action assigned to the Mouse Up event, and click 'Edit'.

4
Reorder Script Logic

Locate the code that sets the fields to read-only (e.g., this.getField("FieldName").readonly = true). Move this block of code so it appears sequentially after your doc.mailDoc() or app.mailMsg() commands.

Adjust Script Execution to Lock Fields After Submission
JavaScript Limitations: Acrobat JavaScript may still struggle to determine if an email was actually sent versus just drafted. Always test the modified script in your target Acrobat version to ensure the workflow behaves as expected.
Efficient PDF Form Management

Easily Manage and Share Fillable PDFs with WPS Office

Avoid complex JavaScript locking issues by using WPS Office to easily fill, protect, and share PDF forms. WPS Office provides an intuitive interface for managing PDF documents, allowing you to secure files without relying on convoluted coding.

  1. 1. Open your PDF Form: Launch WPS Office and open your fillable PDF document.
  2. 2. Fill the Form Fields: Navigate to the 'Form' tab to interact with, type into, or select the necessary fields.
  3. 3. Protect the Document: Once completed, go to the 'Protect' tab to add a restriction password, effectively locking the document from further edits without the need for custom scripts.
  4. 4. Share via Email: Click 'Menu' and select 'Share' or 'Email' to safely attach the finalized, protected document to your default mail client.
Easily fill and interact with PDF forms without complex scriptingSeamlessly share documents via email directly from the applicationHighly compatible with standard Adobe PDF forms and formatsAdd document-level password protection to restrict editing safely
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Acrobat form lock before the email is actually sent?

If the JavaScript attached to the submit button executes the field-locking command before the email command, the form locks immediately upon clicking. If the user then cancels the email draft, the script does not automatically reverse the lock.

Can I unlock the PDF form if I accidentally canceled the email?

Once fields are set to read-only via a script, you cannot unlock them as a standard user unless you close the document without saving and reopen it. Only a user with Acrobat Pro can manually change the field properties back to editable.

Does Adobe Acrobat's JavaScript API know if an email is canceled?

No, Adobe Acrobat's JavaScript API does not consistently return a success, failure, or cancellation callback for email actions like mailDoc(). This makes it very difficult to script an automatic 'unlock on cancel' function.

How do I make a field read-only using PDF JavaScript?

You can use the script this.getField("FieldName").readonly = true; to lock a specific field. To lock all fields, you would typically use a loop that iterates through all fields in the document and applies this property.