title: Total Of Radio Buttons
body: <p>Ok so, I have a form at the moment which lets uers select certain radio buttons but if certain radio buttons are selectd then others cannot. </p>
  
  <p>I have set up a <a href="http://jsfiddle.net/Matt_KP/BwmzQ/" rel="nofollow">JSFIDDLE</a> so you can see this a lot easier. I know the code may look a bit messey.</p>
  
  <p>The problem I am having is at the bottom of the form there is a section <code>Order Total (excluding VAT):</code> which adds up the total of the radio buttons. The problem is for example if you check the radio button at the top left  (£25 Year 1 All Blocks &amp; Units (15 assessments in total) ) Then at the section <code>Order Total (excluding VAT):</code> it shows £25 in the Total Box. Then if you check the radio button below that is £47.50 the total box says £47.50 which is all fine. But then say the user changes there mind and goes back the the £25 option it keeps the £47.50 and adds the £25 on top so it says £72.50 when it should just be £25. You can see the prices for the radio buttons are set by <code>data-price="25"</code></p>
  
  <p>So my question having a look through the code is it possbile for the total to only add up the radio buttons that are checked?</p>
  
  <p>I think it is to do with it caching what has been previouslly selectd and to do with this code?</p>
  
  <pre><code>$('input:radio').change(function(){
      var total = 0.0;
      $('input:radio:checked').each(function(){
          total += parseFloat($(this).data('price'));
      });
      $('#total').val(total.toFixed(2));
  });
  </code></pre>