5 Replies Latest reply on Aug 31, 2016 6:20 AM by tracyy42935226

    Calculation Field Not Updating- Javascript Issue

    tracyy42935226

      I have an Adobe Acrobat DC form with what I believe is a simple issue but has me stumped.  I have a field (InitialDate) in which the user inputs a date.  I have another field in which the user inputs the number of days (AddedDays) .  I want the third field FinalDate to calculate the value by adding the specified number of days from AddedDays to the InitialDate.  Below is the javascript I have added to under the calculate in the FinalDate field.

       

      The javascript works great except when the user CHANGES the date in the InitialDate field, the FinalDate field is not updating.  If the user changes the AddedDays input, the FinalDate field is updating.  Can someone help me?

       

       

       

      (function () {

       

      var sDate = getField("InitialDate").valueAsString;

      var d = util.scand("m/d/yy", sDate);

      var days = getField("AddedDays").value;

       

      d.setDate(d.getDate() + days);

       

      if (sDate) {event.value = util.printd("m/d/yy", d);}

       

      else {event.value = "No Transmission Date Entered";}

      })();