I have this problem that I add 8 textbox and it works fine but when i add more textbox like 16 textbox it doesnt add the last textbox. does anyone encoutered this problem? Thanks in Advance.
function sum() {
var basicpay = document.getElementById('basicpay').value;
var overtime = document.getElementById('overtime').value;
var regularholiday = document.getElementById('regularholiday').value;
var specialholiday = document.getElementById('specialholiday').value;
var allowanceday = document.getElementById('allowanceday').value;
var others = document.getElementById('others').value;
var grosspay = document.getElementById('grosspay').value;
var monthpay13 = document.getElementById('monthpay13').value;
var absent = document.getElementById('absent').value;
var tardiness = document.getElementById('tardiness').value;
var sss = document.getElementById('sss').value;
var pagibig = document.getElementById('pagibig').value;
var philhealth = document.getElementById('philhealth').value;
var cashadvances = document.getElementById('cashadvances').value;
var withholdingtax = document.getElementById('withholdingtax').value;
var others = document.getElementById('others').value;
var result =
parseInt(basicpay) +
parseInt(overtime) +
parseInt(regularholiday) +
parseInt(specialholiday) +
parseInt(allowanceday) +
parseInt(others) +
parseInt(grosspay) +
parseInt(absent) +
parseInt(tardiness) +
parseInt(sss) +
parseInt(pagibig) +
parseInt(philhealth) +
parseInt(cashadvances) +
parseInt(withholdingtax) +
parseInt(others) +
parseInt(monthpay13);
if (!isNaN(result)) {
document.getElementById('totalincome').value = result;
}
}
otherstwice and adding it two times in theresultformula?