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

Date Now and then Stay when document saved

Community Beginner ,
Jan 24, 2021 Jan 24, 2021

Copy link to clipboard

Copied

I have a template form I built in Acrobat Pro DC.  I have a date field that auto populates the date when the document is open.   What I want to do is have that date stay once the document is saved so we know the date it was created. 

 

Example document opned today 1/24/2021   Saved with a new file name and then sent on its way.  The next person recieveing it opens it 1/25/2021   I want the date to still ready 1/24/2021.

 

I know I can  leave it to manual entry but was hoping there was a way to have it auto populate and then stay static the rest of the time.

 

Thanks

David 

TOPICS
How to , JavaScript , PDF forms

Views

228

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 ,
Jan 24, 2021 Jan 24, 2021

Copy link to clipboard

Copied

Post your current code and we'll help you adjust it to achieve that.

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 Beginner ,
Jan 24, 2021 Jan 24, 2021

Copy link to clipboard

Copied

Here is what i have in the properites of the Today text box in the Calculate field

I found this online 

 

var f = this.getField("Today");

f.value = util.printd("mm/dd/yyyy", 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
Community Expert ,
Jan 24, 2021 Jan 24, 2021

Copy link to clipboard

Copied

Change the second line to:

if (f.valueAsString=="") f.value = util.printd("mm/dd/yyyy", 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
Community Beginner ,
Jan 24, 2021 Jan 24, 2021

Copy link to clipboard

Copied

LATEST

OK will do.. Will let you know if it works.  Also is there a way to compress the form then its 2 mb 1 page all fillable with drop downs and check boxes

 

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