Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
6

Initials Field w/ Auto Populating Time Stamp Field

New Here ,
May 07, 2024 May 07, 2024

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?

TOPICS
How to , JavaScript , PDF forms
553
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 07, 2024 May 07, 2024

- 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();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 07, 2024 May 07, 2024

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 07, 2024 May 07, 2024
LATEST

Did you change "TimeStamp1" to the actual name of the field where you want to show timestamp?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 07, 2024 May 07, 2024

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

Regards
Amal
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines