Hi,
I want to do the following:
When a form is opened, the current date, and a unique number are displayed (the unique number is basically an integer representation of the date/time)
I put the following code in the 'initialize' script field of the text fields that I want to have populate:
Date: var thisDate = new Date();
this.rawValue = thisDate.getMonth()+1+"/"+thisDate.getDate()+"/"+thisDate.getFullYear()
ID: this.rawValue = (Math.floor((new Date())/1000))%1000000000;
Now, when I am in the Designer Environment, and preview the PDF, the code works - they change on each preview, but when I save it as a dynamic PDF and open the file repeatedly, the values don't change. It is as if once the file is created, those values are 'frozen'.
I obviously do not want this behaviour, and want the values to reflect the load time.
As well as using the initialize field, I tried form ready and layout ready, with the same results.
Can anyone make some suggestions as to what I can try?
Thanx,
Justin
The description for the "initialize" event:
"You can use this event to perform actions when an object is first created, either as the result of a form filler action or during the form creation process. For example, you can use this event to control settings for new instances of a subform object that a form filler adds to the form by using a button."
Sounds like it should be used for dynamically creating additional dynamic form elements and populating them at the time of creatina.
While the "docReady" event's description:
"This event is the first one that initiates after the form opens in Acrobat or Adobe Reader. Any calculation or scripting tasks that require the full form, or that should only run once when the form filler first opens the form, should use this event. For example, you can use the docReady event to check the version of Acrobat or Adobe Reader and return a message to the form filler if the form filler must upgrade the pplication before filling the form."
Clearly idicates that if you need a value for the form calculated upon opening the form is the action to use.
George Kaiser