Hola
menfis_megadisco
Prueba esto:
Código PHP:
<html>
<head>
<script>
function sumar(frm) {
n1 = parseInt(frm.txt1.value);
if (isNaN(n1)) n1 = 0;
n2 = parseInt(frm.txt2.value);
if (isNaN(n2)) n2 = 0;
document.getElementById('suma').innerHTML = 'Total = '+ (n1 + n2);
}
</script>
</head>
<body>
<form>
<input type="text" name="txt1" onkeyup="sumar(this.form)" />
<input type="text" name="txt2" onkeyup="sumar(this.form)" />
</form>
<p id="suma">Total = 0</p>
</body>
</html>
Saludos,