How to Automatically Insert the Current Date and Reset a PDF Form in Adobe Acrobat
Question details
The user wants to automatically populate a PDF form field with the current date and reset the form fields upon submission.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Submitting a completed PDF form and preparing it for the next entry.
- Observed behavior
- The user needs the correct sequence of actions to ensure the date is inserted and the form is submitted before the reset command clears the fields.
Ensure you are using a fully featured PDF editor that supports JavaScript execution, as basic web browser viewers often block automated form scripts.
Configure a Button Action with JavaScript and Reset Commands
Set up a submit button with a specific sequence of actions: setting the date, submitting the form, and finally resetting the fields.
When automating a PDF form, the order of actions is crucial. You must apply the date and execute the form submission before the reset command triggers; otherwise, the date will be wiped out before the data is sent.
Open your PDF form in edit mode using Adobe Acrobat and prepare your text field for the date.
Add a Button form field to your document, right-click it, and open its 'Properties' dialog.
Go to the 'Actions' tab, select 'Mouse Up' as the trigger, choose 'Run a JavaScript', and click 'Add'. Enter the script to insert the date (e.g., this.getField('Date').value = util.printd('mm/dd/yyyy', new Date());).
Still under the 'Actions' tab, add a 'Submit a form' action immediately following the JavaScript action to send the data.
Add a final action for 'Reset a form' to clear the fields, ensuring this action is strictly ordered at the bottom of the actions list.
Edit, Fill, and Manage PDF Forms with WPS Office
WPS Office provides robust PDF editing capabilities, allowing you to easily manage, fill, and process PDF forms without complex setups.
- 1. Open your PDF: Launch WPS Office and open your PDF document.
- 2. Access form tools: Navigate to the 'Form' tab to access interactive form tools and management options.
- 3. Fill and sign: Use the 'Fill & Sign' feature to easily insert dates, text fields, and signatures manually.
- 4. Save and share: Save or share the completed form directly from the application interface.

Frequently Asked Questions
Why doesn't the auto-date script work when opening the PDF in a web browser?
Many web browsers have built-in PDF viewers that disable or do not fully support JavaScript and advanced form actions for security reasons. Users should open the form in dedicated PDF software to ensure scripts run correctly.
Can I choose which fields to reset in my PDF form?
Yes, when you add the 'Reset a form' action in the button properties, a dialog box will appear allowing you to select exactly which fields should be cleared and which should keep their data.
How do I change the date format in the JavaScript code?
You can modify the format string in the util.printd() function. For example, changing 'mm/dd/yyyy' to 'dd-mmm-yyyy' will output dates like '05-Oct-2023'.




