Copy link to clipboard
Copied
Hello Adobe Support Community World,
I want to implement a PDF document in which there is a time stamp for when you fill out a specific text field with your name. I tried using the "Action" "on mouse click" using the following code but it did not work out.
event.value = util.printd('hh:MM', new Date());
Thanks for the help
Copy link to clipboard
Copied
Instead of event.value use event.target.value.
It may be better to use 'On focus' instead of 'Mouse UP'.
Copy link to clipboard
Copied
Hello there,
I manage to solve this by using the following code:
var f = this.getField("Name");
var g = this.getField("Time");
if (f.valueAsString=="") g.value = util.printd("HH:MM", new Date());
This code is set as run Javascript as 'action on click' when clicking on the field 'Name'.
What happens is that if the field name is empty then the time will appear in the field Time.
Thank you for your help.