PDF Editing Issues

How to Fix a Distributed PDF Form Not Locking After Submission

Elise WilliamsElise Williams Oct 28, 2026 868 views

Question details

The user needs to figure out why an email-based distributed PDF form stopped locking responses after submission following a recent JavaScript modification.

How to Fix a Distributed PDF Form Not Locking After Submission
Product
PDF Editor
Device & OS
not provided
Scenario
Editing form behaviors and scripts in a distributed PDF form.
Observed behavior
The PDF form no longer locks completed fields upon submission, allowing subsequent unwanted modifications.
Before you start

Ensure you have access to both the currently modified PDF form and a backup of the original working version before the JavaScript edits were made.

Solution 1Recommended

Review and Debug the Modified JavaScript

Identify if the recent script edit introduced syntax errors or altered the specific locking function.

When a previously working form stops locking upon submission after a script edit, a JavaScript bug is the most likely culprit. An error might be interrupting the script execution before it reaches the locking command, or the locking logic itself was accidentally removed.

1
Open JavaScript Console

Open your PDF editor's JavaScript debugger or console to check for any runtime errors triggered during the submission process.

2
Compare with Original Script

Place the old working code and the new modified code side-by-side to pinpoint exactly what logic was altered or removed.

3
Verify Locking Function

Ensure that the script explicitly contains the command to make fields read-only (e.g., setting the 'readonly' property to true) and that it executes successfully before the submit action.

Review and Debug the Modified JavaScript
Script Execution Order: Make sure your locking script runs prior to the form data being bundled and sent via email.
Secure Your PDF Forms Easily

Edit and Protect PDF Forms with WPS Office

Avoid complex JavaScript debugging by using WPS PDF to seamlessly create, edit, and encrypt your PDF forms. WPS Office provides intuitive tools to restrict editing and secure your documents without writing a single line of code.

  1. 1. Open the PDF in WPS Office: Launch WPS Office and open your PDF form file.
  2. 2. Navigate to the Protect Tab: Click on the 'Protect' tab in the top ribbon to access document security features.
  3. 3. Restrict Editing: Select 'Encrypt' to set a permissions password. Check the option to restrict editing and printing, effectively locking your form fields from further changes.
  4. 4. Save and Distribute: Save the secured PDF document and distribute it to your users securely.
Easily set read-only permissions and passwords to prevent unwanted edits.Fully compatible with standard PDF formats and Adobe Acrobat forms.Lightweight and user-friendly interface for effortless document management.Built-in PDF editing tools available across Windows, Mac, and mobile platforms.
microsoft office alternative - wps office

Frequently Asked Questions

Can I lock specific fields in a PDF form instead of the whole document?

Yes, you can configure individual form field properties to be 'Read Only' under the field's properties dialog. Using JavaScript, you can dynamically set specific fields to read-only while leaving others editable.

Why does my PDF form submit script work but not the lock script?

This usually happens if the locking script contains a syntax error, or if it is placed after the submit action in the execution queue. The form submission might terminate the script sequence before the locking commands can run.

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

You can restrict editing by applying a permissions password to the PDF. By configuring the security settings to disallow changes in your PDF editor, users will only be able to view or print the document after it's saved.