Hi Guys,
Why can't i do a simple addition. Basically I'm trying to get values from two input boxes and add them together and place that result into another input box. Multiplication and subtraction seem to work well enough, why not addition?
The code is:
<html>
<head>
<SCRIPT language=JavaScript>
function Sub()
{
var ace1 = document.form1.t1.value;
var ace2 = document.form1.t2.value;
var ace3 = document.form1.t3.value;
var tot = ace1 - ace2;
document.form1.t3.value=tot;
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1">
<input type="text" name="t1"><br>
<input type="text" name="t2"><br>
<input type="text" name="t3"><br>
<input type="button" name="Button" value="Button" onClick="Sub()">
</form>
</body>
</html>
Why can't i do a simple addition. Basically I'm trying to get values from two input boxes and add them together and place that result into another input box. Multiplication and subtraction seem to work well enough, why not addition?
The code is:
<html>
<head>
<SCRIPT language=JavaScript>
function Sub()
{
var ace1 = document.form1.t1.value;
var ace2 = document.form1.t2.value;
var ace3 = document.form1.t3.value;
var tot = ace1 - ace2;
document.form1.t3.value=tot;
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1">
<input type="text" name="t1"><br>
<input type="text" name="t2"><br>
<input type="text" name="t3"><br>
<input type="button" name="Button" value="Button" onClick="Sub()">
</form>
</body>
</html>