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

Auto fill dates and days in pdf form

New Here ,
Dec 24, 2024 Dec 24, 2024

Hi,

I found in the community page on how to insert auto date in the pdf form.

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

 

But I want to auto populate both date and day (eg 25 Dec 2024, Wednesday) etc..

I am not sure on the JS or how to write the code.

 

Appreciate any help.

TOPICS
PDF forms
461
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 25, 2024 Dec 25, 2024

Use this format: "dd mmm yyyy dddd"

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 ,
Dec 25, 2024 Dec 25, 2024

Thank you, pardon my ignorant, where do I put the script ? Can provide the full script. Thanks

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 25, 2024 Dec 25, 2024

What do you want the trigger to be?  A button click?  When the PDF opens?  Something else?

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 ,
Dec 25, 2024 Dec 25, 2024

Thanks for the response, I want to auto populate day each time the pdf opens.

Suceeded to apply JS for my date field [this.getField("Today").value = util.printd("dd-mm-yyyy", new Date());] at Document level.

Not sure about Days though? Refer to sample

Peter37077418lfgf_0-1735131312614.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 25, 2024 Dec 25, 2024

If you want the format in the example you provided, use @Nesa Nurani 's format example.  To update when the document opens, enter as a document level script.  You will find all possible date formats in this article.

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 ,
Dec 25, 2024 Dec 25, 2024
LATEST

Thank you, guys it woking well!

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