Ver Mensaje Individual
  #4 (permalink)  
Antiguo 15/08/2011, 22:15
Avatar de andresdzphp
andresdzphp
Colaborador
 
Fecha de Ingreso: julio-2011
Ubicación: $this->Colombia;
Mensajes: 2.749
Antigüedad: 12 años, 10 meses
Puntos: 793
Respuesta: Suma de dos cajas de texto y salga en otra caja de texto

En javascript sería algo como:

Código Javascript:
Ver original
  1. <script type="text/javascript">
  2.     function sumar() {
  3.         var total;
  4.         total = parseInt(t1.value)+parseInt(t2.value);
  5.         r1.value = total;
  6.     }
  7. </script>
  8.  
  9. <form id="formulario" name="formulario" method="post" action="solucion.php">
  10.     <p>
  11.         ingre su numero:
  12.         <input type="text" name="t1" id="t1" />
  13.     </p>
  14.     <p>
  15.         <label>
  16.             ingre su numero:
  17.             <input type="text" name="t2" id="t2" />
  18.         </label>
  19.     </p>
  20.     <p>Reesultado:
  21.         <input type="text" name="r1" id="r1" />
  22.     </p>
  23.     <p>
  24.         <input type="button" name="button" value="SUMAR" onclick="sumar();"/>
  25.     </p>
  26. </form>
__________________
Si sabemos como leer e interpretar el manual será mucho más fácil aprender PHP. En lugar de confiar en ejemplos o copiar y pegar - PHP