Skip to main content
Participant
January 24, 2021
Question

Date Now and then Stay when document saved

  • January 24, 2021
  • 1 reply
  • 704 views

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 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 24, 2021

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

dlafko1Author
Participant
January 24, 2021

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

try67
Community Expert
Community Expert
January 24, 2021

Change the second line to:

if (f.valueAsString=="") f.value = util.printd("mm/dd/yyyy", new Date());