2 Replies Latest reply on Jun 9, 2015 4:12 PM by Angus24

    If/Then statement for null date in Acrobat DC

    Angus24

      I’m working in Acrobat DC, I have a document that is 6 pages long, the first page is in English, the remaining in Spanish.

         

      I have two date fields, one is named AssessmentDate and the other is LongAssessDate. AssessmentDate shows the date in English in this format mm/dd/yy on the first page.

         

      The field LongAssessDate converts the date in the AssessmentDate field into a Spanish format. For example if the Assessment Date
      is 05/24/15 then the date is converted to this format = 24 de mayo de 2015.

       

      This is my coding:

          

      var oField = this.getField("AssessmentDate");

      oDateObject = util.scand("mm/dd/yy", oField.valueAsString);

      event.value = util.printd("date(es){DD ' de ' MMMM ' de'  YYYY}", oDateObject, true);

         

      What I have found is, if the user does not put a date in the AssessmentDate field (they leave it blank), the current date shows in the
      LongAssessDate field.

          

      I’m thinking I need an if/then statement for the LongAssessDate field; if the AssessmentDate value is null or left blank then the LongAssessDate field should be null/blank, but not sure how to do this. Any help is greatly appreciated.

       

      Thank you, Jamie