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

Date field today

Explorer ,
Oct 11, 2024 Oct 11, 2024

Copy link to clipboard

Copied

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();");

TOPICS
Create PDFs , Edit and convert PDFs , JavaScript , PDF , PDF forms

Views

376

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Oct 11, 2024 Oct 11, 2024

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

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

Votes

Translate

Translate
Community Expert ,
Oct 11, 2024 Oct 11, 2024

Copy link to clipboard

Copied

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

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

Votes

Translate

Translate

Report

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
Explorer ,
Oct 13, 2024 Oct 13, 2024

Copy link to clipboard

Copied

Many thanks nesa 

It is working

Votes

Translate

Translate

Report

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 ,
Oct 12, 2024 Oct 12, 2024

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
Explorer ,
Oct 13, 2024 Oct 13, 2024

Copy link to clipboard

Copied

LATEST

Yes dear 

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

Votes

Translate

Translate

Report

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