Ver Mensaje Individual
  #11 (permalink)  
Antiguo 09/09/2010, 17:06
Avatar de _cronos2
_cronos2
Colaborador
 
Fecha de Ingreso: junio-2010
Mensajes: 2.062
Antigüedad: 13 años, 11 meses
Puntos: 310
Respuesta: Imprimir el valor de un campo a otro campo

Código Javascript:
Ver original
  1. function rellenar(campo, texto, este){
  2.  var c = document.getElementById(campo);
  3.  c.value = este.value + texto;
  4. }
Código HTML:
Ver original
  1. <input type='text' onkeyup="rellenar('txt2', '1', this);rellenar('txt4', '1', this);" onblur="rellenar('txt2', this);rellenar('txt4', this);" />
  2. <input type='text' id='txt' />
  3. <input type='text' id='txt2' />
  4. <input type='text' id='txt3' />
  5. <input type='text' id='txt4' />
Saludos (:
__________________
" Getting older’s not been on my plans
but it’s never late, it’s never late enough for me to stay. "
Cigarettes - Russian Red