I'm using jquery to calculate sum of value of input box. but my code only show entered value and don't show the sum of numbers in total.
$(document).ready(function() {
$('input').change(function(e) {
var total_amnt = 0;
var fcharge1 = ($('#fcharge').val());
var lrcharge1 = ($('#lrcharge').val());
var loadingcooly1 = ($('#loadingcooly').val());
var othercharge1 = ($('#othercharge').val());
var crossforothers1 = ($('#crossforothers').val());
var cashpaid1 = ($('#cashpaid').val());
var doorcollection1 = ($('#doorcollection').val());
var transhipment1 = ($('#transhipment').val());
var advanceamt1 = ($('#advanceamt').val());
var stax1 = ($('#stax').val());
var cess1 = ($('#cess').val());
var rebooking1 = ($('#rebooking').val());
total_amnt = fcharge1 + lrcharge1 + loadingcooly1 + othercharge1 + crossforothers1 +
cashpaid1 + doorcollection1 + transhipment1 + advanceamt1 + stax1 + cess1 +
rebooking1;
$('#totamt').val(total_amnt);
});
});