Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Feb 15, 2017 Feb 15, 2017

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

TOPICS
PDF forms
43.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Feb 15, 2017 Feb 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.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 15, 2017 Feb 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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 15, 2017 Feb 15, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 15, 2017 Feb 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 19, 2023 Dec 19, 2023

Nothing auto-populates in my Today date field using that code. I still have to pick a date. What am I missing?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2023 Dec 19, 2023

Where does you use the script?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 19, 2023 Dec 19, 2023

I nthe Validate tab in Properties.Pic.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2023 Dec 19, 2023

Use the script at document level.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 19, 2023 Dec 19, 2023
LATEST

Thank you. I was setting it to populate upon opening, but I wasn't closing and re-opening. My mistake. THANK YOU!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 16, 2022 Nov 16, 2022

Hi, I need assistance with an Adobe Acrobat template that opens with Acrobat DC. The form requires several signtures and a separtate date field  dor each signer to be signed through Adobe Acrobat Sign. I need the form to be able to autofill the date field  when each individual signs. Can you please assist.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 15, 2017 Feb 15, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 02, 2018 May 02, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines