Hey guys i have 6 checkboxes and am using their "rel=" values to add up and display a total sum. However if I check box 1 and 3 and 6 the addition ignores box 3 and does not add it to the sum. So basically the lowest and highest checboxes checked are adding up rather than all that are checked.
Wondering if anyone can spot a reason why.
$(document).ready(function() {
function recalculate() {
var sum = 0;
var base = 0;
var d=new Date();
var theDay=d.getDay();
switch (theDay)
{
case 6:
base = 30;
break;
case 0:
base = 30;
break;
default:
base = 49 ;
}
$("input[type=checkbox]:checked").each(function() {
sum = parseInt($(this).attr("rel")) + base;
});
$("#output").html(sum);
}
$("input[type=checkbox]").change(function() {
recalculate();
});
});