I have find from the forum a answer(Below is the script) which works fine!
The only problem I have is any time when I open the document Acrobat updates the date and the ID field.
How I will make these two fields to be locked so any time we open the form date/ID remains the same values?
Thanks
To get the current date into a field:
FormCalc:
----- form1.#pageSet[0].Page1.DateTimeField1::docReady - (FormCalc, client) ------------------------
$.rawValue = Num2Date(Date())
JavaScript:
----- form1.#subform[0].TextField1::docReady - (JavaScript, client) --------------------------------
var CurrDate = new Date();
$.rawValue = (1 + CurrDate.getMonth()) + "/" + CurrDate.getDate() + "/" + CurrDate.getFullYear();
For the ID:
JavaScript:
----- form1.#subform[0].ID[0]::docReady - (JavaScript, client) -------------------------------------
// ID field docReady JavaScript
$.rawValue = (Math.floor((new Date()) / 1000) ) %1000000000;
Last edited by gkaiseril (2008-04-19 11:44:20)
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script