How to Allow Only Today and Future Dates in Adobe Acrobat PDF Forms
Question details
The user needs to configure a date field in an Adobe Acrobat PDF form to prevent the selection or entry of past dates.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating or modifying an interactive PDF form where users must be restricted to choosing only the current date or a future date.
- Observed behavior
- Acrobat's default date picker natively allows users to select any past, present, or future date without built-in restriction options.
Ensure you are using Adobe Acrobat Pro or Standard, as the free Adobe Reader cannot edit form properties or add validation scripts.
Add a Custom Validation Script to the Date Field
Use Acrobat's custom JavaScript validation feature to compare the selected date with the current date, rejecting any input that falls before today.
Since Adobe Acrobat does not feature a simple checkbox to restrict date ranges, you must apply a custom JavaScript validation script to the specific date field. This script intercepts the user's input before it is finalized.
For this script to function flawlessly, ensure that the date format you enforce in the script exactly matches the format defined in the field's Format tab.
Open your PDF document in Adobe Acrobat, navigate to the Tools menu, and select 'Prepare Form' to enable field editing.
Right-click the target date field on your form and select 'Properties' from the context menu.
Click on the 'Validate' tab at the top of the Properties window, select the 'Run custom validation script' option, and click the 'Edit' button.
Enter a script that parses 'event.value' into a date object, compares it to today's date, and sets 'event.rc = false' if the input date is strictly earlier than today. You can optionally include an 'app.alert()' function to display an error message to the user.
Click 'OK' to close the editor and properties window. Exit Prepare Form mode and test your field by attempting to select a past date, ensuring the script behaves accurately around midnight.

Edit and Manage PDF Forms with WPS Office
While Acrobat offers advanced form scripting, WPS Office provides a highly compatible and lightweight PDF editor for seamless form filling, text editing, and document management across all your devices.
- 1. Open Your PDF: Launch WPS Office and drag and drop your interactive PDF file into the workspace.
- 2. Fill the Form Fields: Click directly on the text boxes, date fields, or checkboxes to input your information seamlessly.
- 3. Save and Share: Go to the Menu and click Save to lock in your form data in standard PDF format, ready for distribution.

Frequently Asked Questions
Why is my PDF date validation script rejecting future dates?
This usually happens because the date format parsed in your JavaScript does not match the format selected in the field's Format tab, causing the script to misinterpret the date strings. Verify that both formats are identical.
Can I add this script using the free Adobe Reader?
No. Adding or editing custom validation scripts requires Adobe Acrobat Pro or Acrobat Standard. Adobe Reader can only execute the scripts when filling out a previously created form.
How do I show an error message when a past date is selected?
Inside your custom validation script, add the function app.alert('Your error message here'); just before the line that sets event.rc = false. This will pop up a warning box when invalid input is detected.
Will the script still work if users manually type the date instead of using the picker?
Yes. The validation script triggers on field blur (when the user clicks out of the field or presses Enter), so manually typed past dates will be rejected in the exact same way as those chosen from the picker.




