I'm using the following JavaScript to prorate the Total from multiple dynamic tables and it works perfectly fine. However, as they are dynamic tables, once a row is filled the total is calculated. But when the row is deleted, the total is not subtracting the deleted row value.
Can anyone help with this?
$('select').prop('required', true);
$('.cf-table-block').on('blur change', '.amnt input', sumtotal);
function sumtotal() {
var s = 0;
$('.amnt input').each(function() {
s += parseNumber($(this).val());
});
$('#Field128').val((s).toFixed(2));
}
function parseNumber(n) {
var f = parseFloat(n); //Convert to float number.
return isNaN(f) ? 0 : f; //treat invalid input as 0;
}