<script type="text/javascript">
window.onload = function() {
var forma = document.forma.elements;
forma[3].onclick = function() {
var val = function(i) {
return parseFloat(forma[i].value);
};
forma[2].value = val(0) + val(1);
return false;
};
};
</script>
<form name="forma">
<input type="text" value="" /> +
<input type="text" value="" /> =
<input type="text" value="" readonly="readonly" />
<input type="submit" value="click" />
</form>