3 Replies Latest reply on Apr 27, 2013 12:44 PM by gkaiseril

    Auto date

    James A Hiltz CET Level 1

      I am having issues getting a auto date function to work in Adobe XI.

      any ideas?

        • 1. Re: Auto date
          try67 MVP & Adobe Community Professional

          Can you provide more information about what you're doing and what's going

          wrong?

          • 2. Re: Auto date
            gkaiseril MVP & Adobe Community Professional

            Make sure you are not using the LiveCycle FormCalc script.

             

            For Acrobat:

             

            event.value = util.printd("d-mmm-yyyy", new Date());

             

            in the Custom Calculation script of  field with a format of "None" will insert the date each time a calculation is run.

             

            If you want the script to only run on a specific event you must select the specific event. Document open scripts are entered into the "Document Scripts" and you can either enter the code statements or create a function and call the function:

             

            function Init() {

            // function to run on opening of the PDF;

            // return the fromatted time string;

            // d-mmm-yyyy format for the date string

            var cFormat = "d-mmm-yyyy";

            // return the formatted string for now

            return util.printd(cFormat, new Date());

            // end Init function;

             

            // name for date field to be filled in;

            var cMyDateField = "DateField Name";

            // set the value of the date field by calling the Init function;

            this.getField(cMyDateField).value = Init();

            // end of document script;

             

            Make sure that JavaScript is enabled. Also check the JavaScript console for errors.

            • 3. Re: Auto date
              gkaiseril MVP & Adobe Community Professional