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

How to create date field that automatically displays today's date in Acrobat DC

New Here ,
Mar 26, 2021 Mar 26, 2021

I would like to post a form online for people to download/print. Each time someone opens up the form, I need a date field on the form to automatically populate today's date and for it to be read only. They must be able to print/download the form for themselves. Thier downloaded form should retain the date that populated when they first printed it. However, the original form as posted online should re-populate today's date for any user who opens it. 

 

I have been experimenting with different Javascript solutions I found online, but many are for other versions of Acrobat and I can't get anything to work. Does anyone have a solutation specifically for Acrobat DC 21.0? The more specific, the better. Thanks so much for any advice! 

TOPICS
How to , PDF forms
1.2K
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
Enthusiast ,
Mar 26, 2021 Mar 26, 2021

Are they opening and fill file online?

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 ,
Mar 26, 2021 Mar 26, 2021

Yes, that's correct. 

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 ,
Mar 26, 2021 Mar 26, 2021
LATEST

Go to Tools - JavaScript - Document JavaScripts and add a new script. Remove all the code that's created by default and add this instead (let's say your field is called "Today"):

 

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

 

This will only work in PDF viewers that support scripting, of course.

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