Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/05/2003, 11:26
Avatar de Kaopectate
Kaopectate
Colaborador
 
Fecha de Ingreso: diciembre-2001
Ubicación: Curaçao (Antillas Holandesas)
Mensajes: 3.179
Antigüedad: 23 años, 2 meses
Puntos: 38
Hola remy.

Prueba esto:

Código PHP:
<html>
 <
head>
  <
script language="JavaScript">
   function 
calcula(){
    var 
val1val2valR;
    
with (document.frm){
     
valR 0;
     
val1 = (op1.value == "" || isNaN(op1.value)? 0parseInt(op1.value10));
     
val2 = (op2.value == "" || isNaN(op2.value)? 0parseInt(op2.value10));
     
valR val1 val2;
     
res.value String(valR);
    }
   }
  
</script>
 </head>
 <body>
  <form name="frm">
   <table border="0">
    <tr>
     <td align="right">
      operando 1
     </td>
     <td>
      <input type="text" name="op1" onkeyup="calcula()">
     </td>
    </tr>
    <tr>
     <td align="right">
      operando 2
     </td>
     <td>
      <input type="text" name="op2" onkeyup="calcula()">
     </td>
    </tr>
    <tr>
     <td align="right">
      Resultado
     </td>
     <td>
      <input type="text" name="res" readonly>
     </td>
    </tr>
   </table>
  </form>
 </body>
</html> 
Saludos.