Skip to main content
Inspiring
October 12, 2024
Answered

Date field today

  • October 12, 2024
  • 2 replies
  • 1165 views

Hello 

I found this script at community which date auto fill automatically as per date today.

But i should close pdf and open again .to change date.

If there are any script  date today  auto fill which pdf always open .

 

this.addScript("init","this.getField(\"Today\").value=new Date();");

Correct answer Nesa Nurani

Place this as 'Document Level' script (use tool 'Document JavaScript'):

this.getField("Today").value = new Date();

2 replies

PDF Automation Station
Community Expert
Community Expert
October 12, 2024

That script is meant to be run from the console or in an Action to automatically add a document level script that runs whenever the document is opened.  When it is opened it will update the "Today" field with the current date.

ali_3480Author
Inspiring
October 13, 2024

Yes dear 

When it is always opened  it will update the "Today" field with the current date 

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
October 12, 2024

Place this as 'Document Level' script (use tool 'Document JavaScript'):

this.getField("Today").value = new Date();

ali_3480Author
Inspiring
October 13, 2024

Many thanks nesa 

It is working