andycheese
Programmer
Hi, I have a page with 7 textboxes (corresponding to days of the week), into which the user can enter a value. I'm wanting a script that is called whenever the user changes a value in one of these boxes (so, presumably onBlur???) and adds up the total of all these boxes, then places it into another box (called TOTAL). I've had a go at doing this, but my code doesn't work at all! If anyone could give me any suggestions, I'd be most grateful.
function totalise()
{
var SUN = document.form1.SUN.value;
var MON = document.form1.MON.value;
var TUE = document.form1.TUE.value;
var WED = document.form1.WED.value;
var THU = document.form1.THU.value;
var FRI = document.form1.FRI.value;
var SAT = document.form1.SAT.value;
var TOTAL = SUN ++ MON ++ TUE ++ WED ++ THU ++ FRI ++ SAT;
document.form1.TOTAL.value == TOTAL;
}
function totalise()
{
var SUN = document.form1.SUN.value;
var MON = document.form1.MON.value;
var TUE = document.form1.TUE.value;
var WED = document.form1.WED.value;
var THU = document.form1.THU.value;
var FRI = document.form1.FRI.value;
var SAT = document.form1.SAT.value;
var TOTAL = SUN ++ MON ++ TUE ++ WED ++ THU ++ FRI ++ SAT;
document.form1.TOTAL.value == TOTAL;
}