troubleshooting Question

JavaScript code in PDF

Avatar of donnie91910
donnie91910 asked on
PDFJavaScript
7 Comments1 Solution107 ViewsLast Modified:
I have a PDF with two text fields on it "Today" and "Tomorrow".  I am trying to have the form read the "Today" field and then display "Today" + 1 day in the "Tomorrow" field.  So, if the "Today" text field is 2/18/2020 then the "Tomorrow" text field will read 2/20/2020.  Here is the code I have so far:
this.addScript("init", "var d = new Date(); var f = this.getField(\"Today\"); if (f.value==\"\") f.value = d; var t = this.getField(\"Tomorrow\"); t.value = t.setDate(d+1);")
ASKER CERTIFIED SOLUTION
leakim971
Multitechnician
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros