title: Adjusting the Total Cost\List Price based on Checkboxes\Radio Buttons
body: <p><strong>Overview:</strong></p>
  
  <p>This is my first time using javascript. I'm trying to use a combination of Radio Buttons and Check Boxes to adjust the "Total Cost" &amp; "Listed Price" of an Item under a number of different conditions. The JS Fiddle reflects where I currently stand. Any suggestions, examples, comments, or form of help would be greatly appreciated as I'm completely stuck.</p>
  
  <p><strong>JS Fiddle (the code is below as well incase you don't want to open JS Fiddle):</strong></p>
  
  <p><a href="http://jsfiddle.net/y2u24x3r/4/" rel="nofollow">http://jsfiddle.net/y2u24x3r/4/</a></p>
  
  <p><strong>The Issues\conditions that I'm completely stuck on:</strong></p>
  
  <p>[Radio 1] How many attendees? (1) (2)</p>
  
  <ul>
  <li>(2) Should double the Total Cost (unless all Four Event Boxes are checked. See Below).</li>
  </ul>
  
  <p>[Radio 2] Are you a Member? (No) (Yes) </p>
  
  <ul>
  <li>(No) should make the cost $26.00 per Event as seen in the
  Jfiddle\code below. </li>
  <li>(Yes) change the displayed Price per Event to $18.00 and automatically adjust the Total Cost.</li>
  </ul>
  
  <p>[Four Event Check Boxes]</p>
  
  <ul>
  <li><p>If all Four Event Boxes are checked, Attendees = '1', and Are you a Member = 'Yes' then override all conditions above and set price to $68.00.</p></li>
  <li><p>If all Four Event Boxes are checked, Attendees = '2', and Are you a Member = 'Yes' then override all conditions above and set price to $136.00.</p></li>
  </ul>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code> &lt;font color="orange"&gt;How many attendees?&lt;/font&gt; &lt;input type="radio" name="attendees" id="attendees" value="1" checked="checked" /&gt;1 &lt;input type="radio" name="attendees" id="attendees" value="2"/&gt;2&lt;br/&gt;
   &lt;font color="orange"&gt;Are you a Member?&lt;/font&gt; &lt;input type="radio" name="member" id="member" value="0" checked="checked" /&gt;No &lt;input type="radio" name="member" id="member" value="1"/&gt;Yes &lt;br/&gt;&lt;br/&gt;
   &lt;form name="listForm"&gt;&lt;font color="orange"&gt;Select the Concerts you want Tickets for:&lt;/font&gt;&lt;br/&gt;
   &lt;input type="checkbox" name="event" value="1" onchange="checkTotal()"/&gt;&lt;font color="#33FF33"&gt; &lt;div class="price"&gt;&lt;/div&gt;&lt;/font&gt;&lt;/input&gt; Nov. 1, 2015 -- Concert 1&lt;br/&gt;
   &lt;input type="checkbox" name="event" value="1" onchange="checkTotal()"/&gt;&lt;font color="#33FF33"&gt; &lt;div class="price"&gt;&lt;/div&gt;&lt;/font&gt;&lt;/input&gt; Dec. 1, 2015 -- Concert 2&lt;br/&gt;
   &lt;input type="checkbox" name="event" value="1" onchange="checkTotal()"/&gt;&lt;font color="#33FF33"&gt; &lt;div class="price"&gt;&lt;/div&gt;&lt;/font&gt;&lt;/input&gt; Jan. 1, 2015 -- Concert 3&lt;br/&gt;
   &lt;input type="checkbox" name="event" value="1" onchange="checkTotal()"/&gt;&lt;font color="#33FF33"&gt; &lt;div class="price"&gt;&lt;/div&gt;&lt;/font&gt;&lt;/input&gt; Feb. 1, 2015 -- Concert 4&lt;br/&gt;&lt;br/&gt;
   &lt;font color="#33FF33"&gt;Total Cost:&lt;/font&gt; &lt;input value="$0.00" readonly="readonly" type="text" id="total"/&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p><strong>Javascript:</strong></p>
  
  <pre><code> function checkTotal() {
     var attendees = document.getElementsByName("attendees");
     var member = document.getElementsByName("member");
     var total = 0;
     var event = 0;
  
      if (member == 0) {
           price = 26.00;
       }           
       else if (member == 1) {
           price = 18.00; 
       }
  
     for (var i = 0; i &lt; event.length; i++) {
       if (event[i].checked) {
         total += parseFloat(member.value);
           total = total * attendees;
  
       }
     }
  
          if (member == 1 &amp;&amp; event == 4 &amp;&amp; attendees == 1) {
           total = 68.00;
          }
  
          if (member == 1 &amp;&amp; event == 4 &amp;&amp; attendees == 2) {
           total = 136.00;
          }
  
       document.getElementById("total").value = "$" + total.toFixed(2);
   }
  </code></pre>