3 Replies Latest reply on Aug 8, 2016 12:14 PM by try67

    java script

    kenwiseman123 Level 1

      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.

        • 1. Re: java script
          try67 MVP & Adobe Community Professional

          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.

          1 person found this helpful
          • 2. Re: java script
            kenwiseman123 Level 1

            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!

            • 3. Re: java script
              try67 MVP & Adobe Community Professional

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