Can you clarify what you want to use the "Tax" field for? Are you wanting to use a specific tax rate to then multiple to the combined subtotal of all items in the table and then display the tax amount in that "Tax" field? And then the "Total" field will be the sum of the combined subtotal with the value in the "Tax" field?
Or are users supposed to input something themselves into the "Tax" field because I see you check for a blur event on that field and then run your function again?
If this is for the first scenario, then you can use something like below
$(document).ready(function() {
$('.tax input').attr('readonly',true);
$('.total input').attr('readonly',true);
$('.cf-table-block').on('blur', 'input', sumtotal);
$(document).on('click', '.form-del-field', sumtotal);
function sumtotal() {
var sum = 0;
$('.cf-table-block tbody tr').each(function () {
var s = 0;
s = parseNumber($(this).find('.price input').val()) * parseNumber($(this).find('.quantity input').val());
$(this).find('.subtotal input').val(s.toFixed(2));
sum += s;
});
$('.tax input').val((sum * 0.15).toFixed(2));
$('.total input').val((parseNumber(sum) + parseNumber($('.tax input').val())).toFixed(2));
}
function parseNumber(n) {
var f = parseFloat(n); //Convert to float number.
return isNaN(f) ? 0 : f; //treat invalid input as 0;
}
});
Note that I made the tax and total fields readonly so it depends solely on the calculation in the table and can't be manipulated otherwise. I also made it so that when a row is deleted from the table, the tax and total gets updated.