Ver Mensaje Individual
  #59 (permalink)  
Antiguo 11/12/2002, 08:19
Avatar de Kaopectate
Kaopectate
Colaborador
 
Fecha de Ingreso: diciembre-2001
Ubicación: Curaçao (Antillas Holandesas)
Mensajes: 3.179
Antigüedad: 22 años, 3 meses
Puntos: 38
59.- Trampa de texto

P: ¿Como puedo redireccionar lo escrito en un elemento HTML hacia otro elemento?

R: [ver ejemplo]

Código PHP:
<html>
 <
head>
  <
script language="JavaScript">
   function 
redirecciona(){
    if (
oTrap.checked){
     
oOutput.innerText += "[trap = " event.keyCode "]";
     
event.returnValue false;
    } else 
oOutput.innerText += String.fromCharCode(event.keyCode);
   }
  
</script>
 </head>
 <body>
  <table border="0">
   <tr>
    <td>
     Texto:<input id="oExample" type="text" onkeydown="redirecciona()">
    </td>
    <td>
     <input type="checkbox" id="oTrap"> Modo debug
    </td>
   </tr>
   <tr>
    <td colspan="2">
     <textarea id="oOutput" rows="10" cols="50"></textarea>
    </td>
   </tr>
  </table>
 </body>
</html> 

Última edición por Kaopectate; 24/12/2002 a las 10:32