Hello, I have designed a form in InDesign and exported it as PDF.
I have created a text field in which the current date should be automatically inserted into this text field the first time it is opened and should not be changed again (not even the next time it is opened).
if(event.value == "")
event.value = util.printd("dd.mm.yyyy", new Date())
Now I am the author and I have to write the code in Acrobat.
However, it already sets the date, which should only happen when the actual user opens and saves the code for the first time?
How can you solve this?
Where does you use the script?
unter Eigenschaften / Berechnung / Benutzerdef. Berechnungsskript
Set the value of the field at document open.
Move the code to a doc-level script (not inside a function!) and adjust it like this:
var f = this.getField("FieldName");
if(f.value == "")
f.value = util.printd("dd.mm.yyyy", new Date())
Then reset the form, save it and close it. Send that file to your users and when they open it, the field will become populated.
Thanks. thats it.
Sorry, i didn't know that.
Thanks to all for the quick support.