Copy link to clipboard
Copied
Hi there,
I've recently created a fillable PDF form. This form has two date fields: (1) "Today" field, which autofills today's date, and (2) "Start Date" field, which autofills 2 weeks from today's date.
This form has been published on our Intranet site. After downloading the form to test it, the document opened in Adobe Acrobat Online, and I noticed that the "Today" field updated to the correct date but the "Start Date" field didn't update correctly. I then tried opening the file in my desktop version of Adobe Acrobat and both dates updated correctly.
I'm wondering why the "Start Date" field isn't updating properly in Adobe Acrobat Online, but works fine in the desktop version? Is it possible to fix this date field so that it also updates correctly in the online version?
I've included a screenshot below of how it appears on the online version - the Start Date field should have autofilled to "03/15/2024". Happy to upload a copy of the file too if need be. Thanks!
Copy link to clipboard
Copied
Because the online version doesn't support scripts.
Copy link to clipboard
Copied
@try67 If that's the case, why does the script work for the "Today" (Agreement Date) field?
Copy link to clipboard
Copied
Maybe it supports some script commands, and not others... What code did you use for both fields?
Copy link to clipboard
Copied
@try67 I used the following document level scripts:
"Today" (Agreement Date) field:
this.getField("Today").value = util.printd("mm/dd/yyyy", new Date());
"Start Date" field:
if (this.getField("Today").valueAsString == "")
this.getField("Start Date").value = "";
else{
var today = util.scand("mm/dd/yyyy", this.getField("Today").valueAsString);
var startDate = new Date(today);
startDate.setDate(today.getDate() + 14);
this.getField("Start Date").value = util.printd("mm/dd/yyyy", startDate);}
Could it have something to do with Document Actions? I programmed the 'Document Will Save' action for the "Today" field and the 'Document Did Save' action for the "Start Date" field.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now