Ver Mensaje Individual
  #6 (permalink)  
Antiguo 20/04/2010, 13:48
Avatar de _cronos
_cronos
 
Fecha de Ingreso: abril-2010
Mensajes: 135
Antigüedad: 14 años
Puntos: 1
Respuesta: Asignar a un campo de un form el valor de otro campo del form cuando éste

¿Así mejor?

Código html:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2.  <head>
  3.   <script type="text/javascript">
  4.    function cambio(){
  5.     document.getElementById("campo2").value=document.getElementById("campo1").value}
  6.   </script>
  7.   <title></title>
  8.  </head>
  9.  <body>
  10.   <form id="formulario" name="formulario" action="">
  11.    <input type="text" id="campo1" onchange="cambio()" onblur="cambio()" onkeypress="cambio()">
  12.    <input type="text" id="campo2">
  13.   </form>
  14.  </body>
  15. </html>