Skip to main content
Participating Frequently
February 1, 2016
Answered

Today's Date in the Footer

  • February 1, 2016
  • 1 reply
  • 1311 views

How do I add a date field in a footer that will display the date as the date the form was opened / printed?

This topic has been closed for replies.
Correct answer try67

Create a (read-only) text field, let's call it Today.

Then go to Tools - JavaScript - Document JavaScripts and create a new script (let's call it "load") with this code:

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

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 1, 2016

Create a (read-only) text field, let's call it Today.

Then go to Tools - JavaScript - Document JavaScripts and create a new script (let's call it "load") with this code:

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

JLSloanAuthor
Participating Frequently
February 1, 2016

First, when I go to tools in Adobe I don't get an option for Java Script.  So I created the Text Field, went to properties, custom options, custom format script, and then entered the  script below in the Format Field.

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

I got the following error message and nothing is displayed or printed on the form.

util.printed is not a function

1:Field:Format

util.printed is not a function

1:Field:Format

InvalidSetError: Set not possible, invalid or unknown.

Field.value:1:Field Today:Format

Any suggestions?

JLSloanAuthor
Participating Frequently
February 1, 2016

I figured it out.  I added the script in the Custom Calculation and it worked.  Thanks for your help!