I have utilized a java script to insert an automatic date/timestamp field in a PDF. I was successful in doing that but it saved the form with the date/time. I want this to be blank each time it's opened and insert the date/time when someone has to fill out the form.
Where did you place the code? What triggers it?
It's within Page Properties, Actions (Select a Java Script)
You need to move it to be a doc-level script, so that it only runs when the file is opened.
What do you mean by "the same thing", exactly?
After you apply the code, clear the form and then save the file and close it. Then the field will be populated the next time you open it.
It saves the date/time even though I clear if off and save. When I open the file again, it has a previous time on it.
Post your code, and/or your file, please.
var f = this.getField("Date/Time");
f.value = util.printd("m/d/yyyy h:mm tt", new Date());
Where does it pull the time from? Now it is inserting the time five minutes ahead of the time showing on my pc.
No, it's not doing that. It's showing the current month instead of the minutes, though...
Change it to:
f.value = util.printd("m/d/yyyy h:MM tt", new Date());
Ok, I tried that and it didn't insert the date or time.
I think I finally got this to work correctly! Thanks to all for your help on this!!
Copy-paste this URL in Google Translate to see a nice tuto and get a nice sample file that will answer your question:
ok thanks, I will take a look.
Set the field as Read-Only.