3 Replies Latest reply on May 21, 2008 1:48 PM by gkaiseril

    Simple Date/Time script gives message when selecting combo box drop down options

      Acrobat 8, Mac OS X

      Hi, I am using a simple Date format auto-populating a text form field. I am new to javascript within acrobat and needed a way to create a custom part number for a printed piece. The formatting of this field is as follows:

      Name of Field: todaysDate

      Format: mdyyyyHHMM

      Javascript rule within the custom calculation script area:
      var f = this.getField("todaysDate");
      f.value = util.printd("mdyyyyHHMM", new Date());

      The date/time is actually working when you initially open the acrobat form. I have many combo boxes on the form containing lists. When selecting EVERY OTHER list option on the form, this message appears:

      "Invalid date/time: please ensure that the date/time exists. Field [todaysDate] should match format mdyyyyHHMM"

      I was wondering if anyone has come across this before, or if there is a better way to create a unique number without using a database of some sort. I'm assuming the form keeps trying to read the time and is having an issue. Is there a rule for just using a start time upon file open only?

      Thank you.