Muddsnapper
Programmer
The script concatenates the 2 numbers before dividing by 2 instead of adding them.
here's the code:
Code:
<SCRIPT LANGUAGE="JavaScript">
function Calc(){
document.autoSumForm.totalBox.value=(document.autoSumForm.weight1.value + document.autoSumForm.rating1.value)/2
}
</script>
</head>
<body>
<form action="test.htm" method="post" name="autoSumForm">
<table width="200" border="1">
<tr><td>
<input type="Text" name="weight1" size="5" onBlur="Calc();" >
</td><td>
<input type="Text" name="rating1" size="5" onBlur="Calc();">
</td></tr>
<tr bgcolor="CCCCCC">
<td valign="top" align="right"><b>Score:</b> <i>(automatically calculated) </i>
<td colspan="2"><input name="totalBox" type="text" onfocus="this.blur()"></td></tr>
</form>
</table>
</body>
</html>