Skip to main content
rakeshk21205956
Inspiring
December 26, 2019
Question

Acrobat Form ...Autofill Date but still change the date manually...

  • December 26, 2019
  • 2 replies
  • 1436 views

i am using the following script to auto-populate the date field ( under custom calculation script);

 

var f = this.getField("MyField");
f.value = util.printd("mm/dd/yyyy", new Date());

 

It works fine.. but i want that after theMAIN FORM is opened and auto-populated.. user can change the date field manually in the MAIN FORM .......... and it will be SAVE AS flattened file.......... again when the MAIN form is opened it should again auto-populate the date

This topic has been closed for replies.

2 replies

Bernd Alheit
Community Expert
Community Expert
December 27, 2019

At document level use this:

var f = this.getField("MyField");
if (f.value == "") f.value = util.printd("mm/dd/yyyy", new Date());
try67
Community Expert
Community Expert
December 26, 2019

Flattening is only possible in Acrobat. Will all the users who will open the file use that application?

rakeshk21205956
Inspiring
December 27, 2019

Let me explain:

There is one MAIN Form (MASTER FILE always fillable), which when opened will auto populate the today's date, now if user wants they can change the date to whatever they want and they will save the form and then SAVE AS the filled form to different name say TEST1 (this file will be readonly).   so now the data in both the forms are same.

 

now, when again the user opens the MAIN FORM some other day, i want the date field to again auto-populate that day's current date and while filling the user can manually change it and again save the form then save as ....

 

i only want , how to make the DATE field so that the manual entry is allowed, now what is happening is , i have put the script in calculation tab. I can change the date manually but when i go to next field the date field automatically reverts to current date .