Imagine having multiple fields for inputting loan totals, let's call them loan1 and loan2 for simplicity.
window.addEvent('domready', function() {
$('loan1').addEvent('change', calculateSubtotal);
$('loan2').addEvent('change', calculateSubtotal);
});
function calculateSubtotal(){
$('subtotal').value = Number($('loan1').value) + Number($('loan2').value) ;
}
After calculating the subtotal of all loans entered, I now aim to generate a grand total by taking 1% of the subtotal and adding 295. This is where I need assistance in converting it into JavaScript.
So the formula stands as follows: loan1 + loan2 = subtotal
(subtotal*.01)+295=Grandtotal
Your guidance on this matter is greatly appreciated!