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

java script

New Here ,
Aug 08, 2016 Aug 08, 2016

Copy link to clipboard

Copied

Hi,

i have problem applying javascript for a fillable document. does anyone know a javascript for applying the current  date and time.

So when i open the document, it will automatically show the current date and time.

Thank you.

TOPICS
Acrobat SDK and JavaScript

Views

325
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
Community Expert ,
Aug 08, 2016 Aug 08, 2016

Copy link to clipboard

Copied

Let's say you have a text field called Today. Go to Tools - JavaScript - Document JavaScripts and create a new item (let's call it MyScripts), with this code:

this.getField("Today").value = util.printd("mm/dd/yyyy HH:MM", new Date());

Click OK and save the file. From that moment on that field will contain the current time and date each time you open the file.

You can adjust the format of the date pattern string in the code to your liking, of course.

Votes

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 ,
Aug 08, 2016 Aug 08, 2016

Copy link to clipboard

Copied

Thank you for your help kindly,

is it possible to do this on a javascript in acrobat x:

1) For time estimation, is it possible to designate mins, hours and the totals. so when i type in the time field. it will show the total time in hh/mm, when the current time commence.

2) For % can we make this a % field, so if we type in "90" it will show "90%"

Thank you!

Votes

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
Community Expert ,
Aug 08, 2016 Aug 08, 2016

Copy link to clipboard

Copied

LATEST

I don't understand how these questions relate to your original question... Please clarify what you mean.

Votes

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