Skip to main content
Participant
February 15, 2017
Answered

Can I make the date field autofill with todays Date with Acrobat DC?

  • February 15, 2017
  • 2 replies
  • 48100 views

Can I make the date field autofill with todays Date with Acrobat DC?

This topic has been closed for replies.
Correct answer try67

I moved your question to the PDF Forms forum.

OK, here's how you do it: Search the tools for Document JavaScripts and open it. Create a new item. Let's call it "load".

Delete any pre-existing code in the window that opens, and paste this code instead into it:

this.getField("Today").value = util.printd("mm/dd/yyyy", new Date());

The code above assumes you have a field called "Today" that you want to populate with today's date. You can change that, as well as the date format, if you wish.

2 replies

Participant
February 15, 2017

Thank you! I was trying to figure out how to add JavaScript under the "Prepare" section in tools. Your help is appreciated

Geckoz100
Known Participant
May 2, 2018

Hello,

I used the above script and it works great.  Will this keep a static date if the the saved form is opened later?  The date will be going on an employee application, so it needs to store the date the application was filled and saved, and should not change later.

Thanks for any help.

try67
Community Expert
Community Expert
February 15, 2017

Yes, it's possible to do that with the desktop version of Acrobat. Is that what you have? Because you posted in the DC PDF Services forum...

Participant
February 15, 2017

I'm thinking I may have posted in the wrong forum. I have a trial version of Acrobat DC on my desktop.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 15, 2017

I moved your question to the PDF Forms forum.

OK, here's how you do it: Search the tools for Document JavaScripts and open it. Create a new item. Let's call it "load".

Delete any pre-existing code in the window that opens, and paste this code instead into it:

this.getField("Today").value = util.printd("mm/dd/yyyy", new Date());

The code above assumes you have a field called "Today" that you want to populate with today's date. You can change that, as well as the date format, if you wish.