Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/02/2012, 13:30
Avatar de jotaincubus
jotaincubus
 
Fecha de Ingreso: mayo-2005
Ubicación: Medellin - Colombia
Mensajes: 1.797
Antigüedad: 19 años
Puntos: 394
Respuesta: Operaciones en tiempo real

Aqui te va un pequeño ejemplito....

Código Javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6.  
  7. <script>
  8. function sumar(uno,dos)
  9. {
  10. var total;
  11. total = parseInt(uno.value)+parseInt(dos.value);
  12. <!-- alert("El valor es " + total); -->
  13. document.prueba.total.value = total;
  14. }
  15. </script>
  16.  
  17. </head>
  18.  
  19. <body>
  20. <form name="prueba">
  21. uno<input type="text" name="uno">
  22. dos<input type="text" name="dos">
  23. <input type="button" name="Ver total" value="Ver total" onclick="sumar(uno,dos)">
  24. <input type="text" name="total" value=""/>
  25. </form>
  26. </body>
  27. </html>
__________________
Por que existe gente que no agradece después de que se le ha brindado tiempo y ayuda ???