Copy link to clipboard
Copied
I have a document with several line items that I am looking to create a initial field next to each line item. Once initials are entered, there would be a seperate field next to it that auto populates a time stamp (date/time). This document may not be completed all in one sitting so it seems the e-signature would not be the solution. In addition, this document would be used multiple times so I am not sure if there is a way to clear all fields after each use?
Copy link to clipboard
Copied
- You can use a script to populate a field with the current time when a value is entered in the initials field.
The basic code to do that is something like this (as the custom Validation script of the initials field):
if (event.value) this.getField("TimeStamp1").value = util.printd("mmddyyyy_HHMMss", new Date());
else this.getField("TimeStamp1").value = "";
- Sure. You can add a button that clears the entire form when clicked, using the built-in "Reset Form" action, or this code:
this.resetForm();
Copy link to clipboard
Copied
Thank you! I am pretty new to code for Adobe. I am creating a text field to enter initials. I pasted your code under "Run customer validation script:". Doing so, when I enter text nothing happens. I was successful with creating a reset button so there's a start and thank you for your help!
Copy link to clipboard
Copied
Did you change "TimeStamp1" to the actual name of the field where you want to show timestamp?
Copy link to clipboard
Copied
Hi there
Hope you are doing well and thanks for reaching out.
The workflow you are trying to achieve is might be possible using JavaScript. For more information please check the help pages listed below:
https://acrobatusers.com/tutorials/javascript_console/
https://helpx.adobe.com/acrobat/using/applying-actions-scripts-pdfs.html
Hope it will help
Regards
Amal