PDF Editing Issues

How to Automatically Insert the Current Date and Reset a PDF Form in Adobe Acrobat

Phi Hung VoPhi Hung Vo Nov 3, 2026 869 views

Question details

The user wants to automatically populate a PDF form field with the current date and reset the form fields upon submission.

Automatically Insert the Current Date and Reset an Acrobat Form
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.
Before you start

Ensure you are using a fully featured PDF editor that supports JavaScript execution, as basic web browser viewers often block automated form scripts.

Solution 1Recommended

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.

1
Open form editing mode

Open your PDF form in edit mode using Adobe Acrobat and prepare your text field for the date.

2
Add a submit button

Add a Button form field to your document, right-click it, and open its 'Properties' dialog.

3
Add JavaScript for date

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());).

4
Add form submission

Still under the 'Actions' tab, add a 'Submit a form' action immediately following the JavaScript action to send the data.

5
Add form reset

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.

Testing is Important: Always test your form submission within Acrobat. External browser viewers may restrict form submission behaviors or fail to run the JavaScript properly.

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. 1. Open your PDF: Launch WPS Office and open your PDF document.
  2. 2. Access form tools: Navigate to the 'Form' tab to access interactive form tools and management options.
  3. 3. Fill and sign: Use the 'Fill & Sign' feature to easily insert dates, text fields, and signatures manually.
  4. 4. Save and share: Save or share the completed form directly from the application interface.
Easily create, fill, and sign PDF formsHighly compatible with standard Adobe PDF formatsAdd text, dates, and signatures with a few clicksFree and lightweight alternative for daily document processing
microsoft office alternative - wps office

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'.