View Full Version : Today's Date in Acrobat form

12-17-2003, 05:38 PM
I have a date field in an Acrobat (v 5.0.1) form and I want it to be preloaded with the current date when the user opens the form. I have to work within Acrobat's code box and I used the following (provided in their documentation) but it didn't work:
The script name is Today

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

The message I get is
TypeError: f has no properties . Can you help? Thanks.

12-17-2003, 06:45 PM
If "f has no properties" then presumably it's not a Field object. How did you create it?

By "The script name is Today" ....did you mean the field's name?

12-17-2003, 10:30 PM
In the Acrobat Help, in their JavaScript section, they provide code to fill a form field with the current date. I cut and pasted it directly.

And Today is the name of the script. Acrobat asks you to fill in a name and it calls that the name of the "script."

12-18-2003, 03:20 AM
Would need to see the entire (generated) page.

12-18-2003, 04:27 AM
That's not possible. Thanks anyway.

12-18-2003, 04:55 AM

12-18-2003, 05:46 AM
Thank you so much! It worked perfectly. I'm not sure why I came here instead of visiting Adobe's site -- maybe it's the personal touch we give and get! Thanks.