Help making time and date in Adobe dc

New Here ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

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!! 

TOPICS
Create PDFs, How to, JavaScript, PDF forms

Views

291

Likes

Translate

Translate

Report

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 Community Professional ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

If you want to do the same using the time change "yyyy/mm/dd" in the above to "HH:MM", for example.

Likes

Translate

Translate

Report

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 ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

Is there a way to make it auto populate when you just click the box and not the small skinny tab on the right and then select a date and then it populates? Just need 1 click on box it it automatically puts the date in without selecting it

Get Outlook for iOS

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

As the On Focus event of the field enter the following code:

event.target.value = util.printd("yyyy/mm/dd HH:MM",new Date());

Likes

Translate

Translate

Report

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 ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

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!! 

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

Not sure what you mean by "off line"... This script doesn't require internet connection to work.

Likes

Translate

Translate

Report

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 ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

I saved the pdf and pulled it up on another computer and the fields I created with your help are blank and unclickable.. went back into dc and tested it and it works great just not through a pdf reader.  And JavaScript is enabled on the reader

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

In what application did you open it on the other computer, exactly?

Likes

Translate

Translate

Report

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 ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

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  

A7E1D0E5-302F-49EB-986B-6E4AE49CB6A9.png

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

Scripts won't work on a mobile device, either, I'm afraid. It should work if opened in Reader on a regular PC, though.

Likes

Translate

Translate

Report

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 ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

Same thing is happening on our PCs at work.  Running windows 10.  Same issue.  Can't figure out why

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Apr 14, 2021 Apr 14, 2021

Copy link to clipboard

Copied

LATEST

Are you sure you're using Reader? Post a screenshot of it, please.

Likes

Translate

Translate

Report

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