7 Replies Latest reply on May 18, 2015 8:10 AM by petes3000756

    Urgent Urgent Urgent help with javascript - already have code but is not working

    petes3000756

      Hi

       

      I have the code below connected to three check boxes named 'mon, 'fri' and 'sat'. Each value is 50. The aim is to make a different text box have the total to show that when all three are checked then 150 will show. However, currently the 'mon' box is inverted i.e. its need to be unchecked to show 50 rather than checked to show 50. Any help much appreciated!!!!

       

      var counter = 0;
      if (this.getField("mon").value!="Off") counter++;
      if (this.getField("fri").value!="Off") counter++;
      if (this.getField("sat").value!="Off") counter++;

       

      if (counter==1) event.value = "50";
      else if (counter==2) event.value = "100";
      else if (counter==3) event.value = "150";
      else event.value = "0";