2 Replies Latest reply on Jun 5, 2013 2:53 PM by RichP01

    Calculation error for Total field

    RichP01

      Using Acrobat Pro X - I have 6 dropdown fields with option export values on my form.  I want to add the export values to determine a charge for this section of my form.  The total is appearing as "NaN" instead of a numeric value usually after selecting from the second dropdown. Here is the code:

       

      // Default export value of each selected wkshop is 1

       

      var fee = 0;

      var a = this.getField("AMFri927").value;

      var b = this.getField("PMFri927").value;

      var c = this.getField("AMSat928").value;

      var d = this.getField("PMSat928").value;

      var e = this.getField("AMSun929").value;

      var f = this.getField("PMSun929").value;

      var m = this.getField("Check_mem").value;

      var s = this.getField("Check_stu").value;

      var t = a + b + c + d + e + f;

       

      // Check student and member checkboxes

      if (s == "Yes"){     // student member wkshop = $5

      fee = t * 5;           // Calculate student fee for workshops

      } else {

      if (m == "Yes"){    // member wkshop = $45

      fee = t * 45;         // Calculate member fee for workshops

      } else {                  // nonmember workshops = $75

      fee = t * 75;         // Calculate non-member fee for workshops

      }

      }

      event.value = fee;