onblur calculate the sum.
i have a problem with total calculation on change input box
it only show the change box value, it don' t sum
in total input box.
can you please help me
here are the code
<script>
function calculat(id){
var total= $("#bank_"+id).val(); // this will take the value of bank_1
total+ // This do not work
$("#total").val(total); // display in the total input box
}
</script>
<input type="text" id="bank_1" onblur="calculat(1);" name="bank[1]" />
<input type="text" id="bank_2" onblur="calculat(2);" name="bank[2]" />
<input type="text" name="total" id="total" />