Hi Got a problem about adding a number
I got this code :
// toggle disable enable add subtotal function
function calculateSumDisabled(sourceCalc , targetCalc) {
//var sumTotal = 0;
var sumTotal = parseFloat(targetCalc.html());
if ($(sourceCalc).attr('disabled') === true) {
sumTotal = (sumTotal - sourceCalc.val()) ;
} else {
// sumTotal = (sumTotal + sourceCalc.val()) ;
}
$(targetCalc).html(sumTotal);
}
and while subtracting the value working as intended but when adding the value then the problem occurs.
for example the sumTotal is 100 and the sourceCalc.val() is 10
then when subtracting 100 - 10 is 90.
but when adding 100 + 10 = 10010
what could be the problem here?
Thanks for the help.