title: Multiple checkbox total value and apply discount
body: <p>I am trying to get a running total and then if more than one checkbox is selected to apply a discount.</p>
  
  <p>Price is based on time.So...<br>
  Back massage = 30 minutes = $50<br>
  Neck massage = 30 minutes = $50<br>
  Legs and feet = 30 minutes = $50<br>
  Total = (if one selected then price = $50)<br>
  if more than one then apply discount of $25
  on submit an email will be sent to the client. So its not an ecommerce site thereofore not necassary to do server side calculations.</p>
  
  <p>This is my code at the moment:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
      function checkTotal() {
          document.listForm.total.value = '';
          var sum = 0;
          for (i=0;i&lt;document.listForm.choice.length;i++) {
            if (document.listForm.choice[i].checked) {
              sum = sum + parseInt(document.listForm.choice[i].value);
            }
          }
          document.listForm.total.value = sum;
      }
  &lt;/script&gt;
  
  &lt;form name="listForm"&gt;
  &lt;input type="checkbox" name="choice" value="50" onChange="checkTotal()"/&gt;Back Massage - 30 Minutes&lt;br/&gt;
  &lt;input type="checkbox" name="choice" value="50" onChange="checkTotal()"/&gt;Neck Massage - 30 minutes&lt;br/&gt;
  &lt;input type="checkbox" name="choice" value="50" onChange="checkTotal()"/&gt;Shoulder Massage - 30 Minutes&lt;br/&gt;
  &lt;input type="checkbox" name="choice" value="30" onChange="checkTotal()"/&gt;Head Massage - 15 minutes&lt;br/&gt;
  Total: &lt;input type="text" size="2" name="total" value="0"/&gt;
  &lt;/form&gt;
  </code></pre>