You would want to do something like this:
var sum = 0;
$(".fieldsbankrecon1").each(function()
{
if(!isNaN(this.value) && this.value.length!=0)
{
sum += parseFloat(this.value);
}
});
Update
Add the following div to the body of your document
<div id="output">
</div>
This script will automatically recalculate the sum as the user checks and unchecks the checkboxes:
<script>
var evaluateFields = function ()
{
var sum = 0;
var n = $("input:checked").each(function ()
{
$(this).parent().find(".fieldsbankrecon1").each(function ()
{
sum += parseFloat(this.value);
});
});
$("#output").text("Sum:"+sum);
};
evaluateFields();
$("input[type=checkbox]").on("click", evaluateFields);
</script>
You can also add multiple fields with the appropriate class to each of your divs.
Best regards
Espen Harlinn