Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
function sumar() {
elem_1 = (isNaN(document.guardar.1.value)) ? "0" : document.guardar.1.value;
elem_2 = (isNaN(document.guardar.2.value)) ? "0" : document.guardar.2.value;
//var t=0;
//t=parseInt(elem_1)+parseInt(elem_2);
document.guardar.SAT.value = parseInt(elem_1) + parseInt(elem_2);
//document.guardar.SAT.value=t;
}
</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD=POST ACTION="a" name="guardar">
1: <input type="text" name="area" size="25" maxlength="50" value="" onkeyup="javascript:sumar();" id="1"><br>
2: <input type="text" name="terraza_techada" size="25" maxlength="50" value="" onkeyup="javascript:sumar();" id="2"><br>
3 RESULTADO: <input type="text" name="SAT" size="25" maxlength="50" value="" id="SAT"><br>
</FORM>
</BODY>
</HTML>