Ver Mensaje Individual
  #2 (permalink)  
Antiguo 31/05/2012, 20:07
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: El otro tex no cambia

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript">
  7. //<![CDATA[
  8. function pasar(){
  9. var tx1 = document.getElementById('tx1');
  10. var tx2 = document.getElementById('tx2');
  11. document.getElementById('tx3').value = tx1.value;
  12. document.getElementById('tx4').value = tx2.value;
  13. // si querés eliminar los valores de 1 y 2 al pasarloas a 3 y 4
  14. tx1.value = ""
  15. tx2.value = "";
  16. }
  17. //]]>
  18. </head>
  19. <form action="#">
  20. 1. <input type="text" value="" id="tx1" /> 3. <input type="text" value="" id="tx3" /><br />
  21. 2. <input type="text" value="" id="tx2" /> 4. <input type="text" value="" id="tx4" /><br /><br />
  22. <input type="button" value="pasar" onclick="pasar();" />
  23. </form>
  24. </body>
  25. </html>

usar parseInt solo será necesario cunado recuperes los valores para usarlos en una operación aritmética posterior

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.