This should be easy. Simply get the form fields into variables, then just add the values together:
Code:
var amt1 = document.getElementById("Amount1").value;
var amt2 = document.getElementById("Amount2").value;
var amt3 = document.getElementById("Amount3").value;
var amt4 = document.getElementById("Amount4").value;
//-- Either hidden field for postback, or other form field for display
var Total = document.getElementById("Total");
Total = amt1 + amt2 + amt3 + amt4;
You could use a loop to retrieve form values and add them to the Total but how you do that would depend on what other fields may be present.
Bookmarks