Hello,
I am using your code in the help files to add few fields. That is working well. But I need it to add even when default values are assigned to the fields , so that the user sometimes need not need have to worry about typing a value.
This is the current code I am using.
$(document).ready(function () {
$('.sum').on('blur', 'input', sumtotal);
function sumtotal() {
var s = 0;
$('.sum input').each(function () {
s += parseNumber($(this).val());
});
$('.total input').val(s);
}
function parseNumber(n) {
var f = parseFloat(n); //Convert to float number.
return isNaN(f) ? 0 : f; //treat invalid input as 0;
}
});