I have a form with several input fields and a "total" box that displays the sum of those input fields. Within the form is a section that calculates mileage cost from one point to another and automatically fills out an input with the result. What I notice is that this number does not get added onto the total until I have filled out another form field.
What I need is for it to be auto filled and then straight away be added onto the total. See here for my workings http://www.samskirrow.com/projects/distr/index2.html - the distance calc is at the bottom of the page and total is at the top
My code to calculate the sum is as follows:
$(".txt, .select, .checkbox").each(function() {
$(this).change(function(){
calculateSum();
});
});