Here is what i want to do, check the image attached, javascript to sum the values of text boxes in a row having individual total, i have this but not working
function sum() {
var txtFirstNumberValue = document.getElementsByName('ca_score[]').value;
var txtSecondNumberValue = document.getElementsByName('score[]').value;
if (txtFirstNumberValue == "")
txtFirstNumberValue = 0;
if (txtSecondNumberValue == "")
txtSecondNumberValue = 0;
for(var i=0;i<txtFirstNumberValue.length;i++) {
var result = parseInt(txtFirstNumberValue[i]) + parseInt(txtSecondNumberValue[i]); }
if (!isNaN(result)) {
document.getElementsByName('total[]').value = result;
}
}