I'd use jquery (jquery.com) even though it seems a very simple thing to do you probably want to be sure the script works in all standard browsers. Also you'll discover some exciting functionality at your fingertips :)
<input type="text" id="fistBox" value="1">
<input type="text" id="secondBox" value="2">
<nput type="text" id="result" value="">
<script>
var theResult = $("#fistBox").value+ $("#secondBox").value;
$('#result').text(theResult);
</script>