We have forms that have several different sections on our form that need to be clicked for current time and date separately. Essentially a time stamp when an item or line is completed . They would for instance click on the box and populate the date or time in each box. Is this possible? We currently use a physical time stamper and we are trying to move paperless. Any hep would be greatly appreciated!!
Here is basic code to show current date:
var f = this.getField("Text1");
f.value = util.printd("yyyy/mm/dd",new Date());
Change field name and format as you wish.
Use it as 'Mouse UP' event of the field, if you use it on a text field it will show once you click out of the field, or you can use it in a button to populate text field.
If you need additional help let me know.
If you want to do the same using the time change "yyyy/mm/dd" in the above to "HH:MM", for example.
As the On Focus event of the field enter the following code:
event.target.value = util.printd("yyyy/mm/dd HH:MM",new Date());
This is GREAT!! Finally got it to work . Now the second question is can this be used as a saved pdf off line and still use the time stamps. I saved it and opened it up (read only for the times because we don't want anyone changing them) and it won't let me click and populate the time and date. You've been a great help tonight!!
Not sure what you mean by "off line"... This script doesn't require internet connection to work.
In what application did you open it on the other computer, exactly?
Adobe acrobat reader. Tried on my phone as well. Looks like this.. the time date fields are blank and aren't taking in the current date or time or anything
Scripts won't work on a mobile device, either, I'm afraid. It should work if opened in Reader on a regular PC, though.
Same thing is happening on our PCs at work. Running windows 10. Same issue. Can't figure out why
Are you sure you're using Reader? Post a screenshot of it, please.