This is probably incredibly simple, but I'm very new at this, and I not sure how to get this to work. What I want is for the box for the total to display a runnning total. The total should change as numbers are entered without having to hit "Submit". Obviously, this is a very simple example, but if I can get this one, I can get the the rest of it.
Thank you very much! Calista :-X
Jedi Knight,
Champion of the Force
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<SCRIPT>
<!--
var x = 0;
var y = 0;
var SumXY = 0;
function calculate()
{
var SumXY = x + y;
}
//-->
</SCRIPT>
</head>
<body>
<FORM ACTION="#CGI.SCRIPT_NAME#" METHOD="post" NAME="MyForm" ID="MyForm">
<B>VarX</B><BR>
<INPUT TYPE="text" NAME="VarX" VALUE="0.00" SIZE="5" MAXLENGTH="5" ONCHANGE="x=VarX"><BR>
<B>VarY</B><BR>
<INPUT TYPE="text" NAME="VarY" VALUE="0.00" SIZE="5" MAXLENGTH="5" ONCHANGE="y=VarY"><BR><BR>
<B>VarSum</B><BR>
<INPUT TYPE="text" NAME="VarSum" VALUE="0.00" SIZE="5" MAXLENGTH="5" ONCHANGE="calculate()"><BR>
</FORM>
</body>
</html>
Jedi Knight,
Champion of the Force