Subtotaling in jquery function (.click issues?)
<p>This function only subtotals my last value clicked when I use the .hasVal class with a radio button. Any ideas? </p>

<p>Update: Here's the jsfiddle link: <a href="http://jsfiddle.net/SUKsM/4/" rel="nofollow">http://jsfiddle.net/SUKsM/4/</a></p>

<p>Essentially my HTML form has a fieldset with values:</p>

<pre><code>&lt;fieldset id="breadOptions" class="hidden"&gt;
    &lt;legend&gt;Select one&lt;/legend&gt;
    &lt;input type="radio" name="breadType" id="breadWhite" class="hasVal" value=".5,260" /&gt; White (260 calories)&lt;br /&gt;
    &lt;input type="radio" name="breadType" id="breadWheat" class="hasVal" value=".5,360" /&gt; Wheat (360 calories)&lt;br /&gt;
&lt;/fieldset&gt;​
</code></pre>

<p>An here's the script:</p>

<pre><code>$(function () {
    var basePrice = 3;
    var totalCal = 0;
    var taxRate = .07;
    $('#total').text(basePrice.toFixed(2));
    $('#sub').text(basePrice.toFixed(2));
    $('#cal').text(totalCal);
    $('#tax').text((taxRate * 100).toFixed(2));

    $('.hasVal').click(function () {
        var price = 0;
        var totalCal = 0;
        var tar = event.currentTarget;
        var optArr = tar.value.split(','); //cost,calorie

        price += parseFloat(optArr[0]);
        totalCal += parseInt(optArr[1]);

        $(':checked').each(function () {
            totalPrice = (price + basePrice);
        });

        $('#sub').text(totalPrice.toFixed(2));
        $('#cal').text(totalCal);

        totalTax = totalPrice + (totalPrice * taxRate);
        $('#total').text(totalTax.toFixed(2));
    });
});
</code></pre>
