PDF Editing Issues

How to Make an Acrobat PDF Date Picker Read-Only After Selection

Bushra ParveenBushra Parveen Oct 28, 2026 869 views

Question details

The user wants to lock a date picker field in an Acrobat PDF form, making it read-only once a user has selected a valid date.

How to Make a PDF Date Picker Read-Only After Selection in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating interactive PDF forms where the selected date needs to be finalized and protected from further edits.
Observed behavior
Currently, the date picker allows users to continuously change the date. The goal is to restrict editing automatically after the initial valid selection.
Before you start

Ensure you have access to Adobe Acrobat Pro to edit form fields and add custom JavaScript. It is highly recommended to save a backup copy of your PDF form before applying scripts, in case you need to revert changes.

Solution 1Recommended

Use Custom JavaScript to Lock the Date Picker

Applying a simple JavaScript code to the date field's validation or calculation logic will make it read-only immediately after a date is chosen.

To automate the locking process, you can bind a short JavaScript snippet to the specific date field. This ensures that once the date picker writes the value into the field, it immediately locks.

1
Enter Prepare Form Mode

Open your PDF document in Adobe Acrobat, navigate to the 'Tools' menu, and select 'Prepare Form' to enable form editing.

2
Access Field Properties

Right-click on the target date picker field and select 'Properties' from the context menu.

3
Add Custom Validation Script

Navigate to the 'Validate' tab and select the option 'Run custom validation script'. Click the 'Edit' button.

4
Input the JavaScript

Type the following script into the JavaScript Editor: if (event.value) { event.target.readonly = true; }. Then click 'OK' to save.

5
Test the Form

Close the form editing mode and select a date using the date picker to verify that the field successfully locks.

Use Custom JavaScript to Lock the Date Picker
Provide a Reset Option: Since the field locks permanently upon selection, consider adding a 'Reset' or 'Unlock' button with a script to clear the field and set event.target.readonly = false in case the user makes a mistake.
Secure Your PDF Forms Easily

Finalize and Protect PDF Forms with WPS Office

Instead of relying on complex custom JavaScript, you can easily fill out your PDF forms and use WPS Office to flatten the document or restrict editing, ensuring no further changes can be made to your date pickers or text fields.

  1. 1. Open your PDF: Launch WPS Office and open your interactive PDF form containing the date picker.
  2. 2. Fill out the Form: Select the desired date in the date picker and fill in any other necessary form fields.
  3. 3. Flatten or Protect the Document: Navigate to the 'Protect' tab. You can restrict editing with a password or use the 'Print' function to print to 'WPS PDF' to flatten the document, permanently locking the date field.
  4. 4. Save your Secure File: Save the newly protected or flattened PDF locally to share it securely without risking unauthorized edits.
Easily create, fill, and edit interactive PDF formsFlatten PDF documents with one click to lock all form fields instantlyFully compatible with Adobe Acrobat PDF formats and form elementsLightweight and intuitive interface for seamless document management
microsoft office alternative - wps office

Frequently Asked Questions

How can a user correct the date if the field is locked by mistake?

You can add a dedicated 'Clear' or 'Reset' button to your PDF form. Assign a JavaScript action to this button that clears the date field's value and sets the readonly property to false to unlock it.

Can I lock the entire PDF form instead of just the date picker?

Yes, you can use PDF security settings to restrict editing globally, or simply flatten the document so that all interactive fields, including date pickers, become permanent text.

Does this JavaScript read-only method work in all PDF readers?

JavaScript support varies by PDF viewer. While it works reliably in full-featured desktop software like Adobe Acrobat and WPS Office, some browser-based PDF readers or mobile viewers might ignore the script.

Why does the date picker lock before I finish selecting a complete date?

This usually happens if the script is placed in the Keystroke event rather than the Validate or Calculate event. Ensure the script runs only after a valid date has been committed to the field.