View Full Version : populate an Acrobat field with a date only once?

01-23-2009, 09:23 AM
Hello everyone, I have a small script which runs when the acrobat document opens and populates a field with the date, but I would like the date to be filled when the document is first opened, then saved with that date. Could someone help with this script?

// get new Date object
var d = new Date();

// format to mm/dd/yyyy
var sDate = util.printd("dd/mm/yyyy", d);

// insert date into form field
this.getField("todaysDate").value = sDate;



Philip M
01-23-2009, 09:28 AM
Wrap it in a function and call it with

<body onload = "functionName()" ....

It is your responsibility to die() if necessary… - PHP Manual