Código HTML :
<html > <head> <title>ejemplo</title> </head> <body> <form name="form1" method="post" action="registra_suma.php"> <table> <tr><td>numero 1</td><td>numero 2</td><td>total</td></tr> <tr> <td><input onKeyUp="if(form1.textfield2.value!=''){form1.textfield3.value = parseInt(this.value)+parseInt(form1.textfield2.value)}" name="textfield1" type="text" size="8" maxlength="8"></td> <td> <input onKeyUp="if(form1.textfield2.value!=''){form1.textfield3.value = parseInt(this.value)+parseInt(form1.textfield1.value)}" name="textfield2" type="text" size="8" maxlength="8"></td> <td><input name="textfield3" type="text" size="10" maxlength="10"> </td></tr> </table> <p>iva=<?PHP $iva=0.19; echo "$iva";?> </p> <p>total:</p> </form> </body> </html>