Ok, here's the code for addition instead of concatenation. The only difference is that the variables each call parseInt. Another way to do it would be to multiply the variables by 1 to force them to cast as numbers.
Code:<html>
<head>
<script>
function calculate(){
top = parseInt(document.theForm.top.value, 10);
middle = parseInt(document.theForm.middle.value, 10);
bottom = parseInt(document.theForm.bottom.value, 10);
total = top+middle+bottom;
document.theForm.result.value = total;
}
</script>
</head>
<body>
<form name="theForm">
Top: <input type="text" name="top" value="0" onchange="calculate()" /><br />
Middle: <input type="text" name="middle" value="0" onchange="calculate()" /><br />
Bottom: <input type="text" name="bottom" value="0" onchange="calculate()" /><br />
Result: <input type="text" name="result" value="0" onchange="calculate()" /><br />
</form>
</body>
</html>