7 Replies Latest reply on Nov 15, 2016 7:28 AM by brian704

    error message when setting today's date in a field

    brian704 Level 3

      I'm trying to get Acrobat to pre-populate a date field with today's date. I have placed the following code in the "Page Open" section:

       

      var f = this.getField("Date");

      f.value = util.printd("mm/dd/yyyy", new Date());

       

      Date is the field name. The format matches the format for the field. When I open the document I get the following error:

       

      "Invalid date/time: please ensure that the date/time exists. Field [Date] should match format mm/dd/yyyy"

       

      The date appears in the field with the proper format. Any idea why I'm getting the error?