6 Replies Latest reply on Mar 20, 2017 5:47 AM by rae333

    Finding the sum of the amount of checkboxes checked. Only 2 columns work.

    rae333

      I have a form with a bunch of questions and then options Yes, No, NA. You can select a checkbox under each answer and then at the bottom i have a box that totals each column into "#Yes" "#no" "#NA". I have used the same script in ALL THREE boxes but only 2 (Yes and No) work. The NA column shows no number total.

       

      var total = 0;

      for (var i=1; i<=20; i++) {

      if (this.getField("Yes"+i).value!="Off") total++;

      }

      event.value = total;

       

      var total = 0;

      for (var i=1; i<=20; i++) {

      if (this.getField("No"+i).value!="Off") total++;

      }

      event.value = total;

       

      var total = 0;

      for (var i=1; i<=20; i++) {

      if (this.getField("Na"+i).value!="Off") total++;

      }

      event.value = total;