Ver Mensaje Individual
  #6 (permalink)  
Antiguo 11/08/2003, 01:37
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 3 meses
Puntos: 772
Hola a todos.

La función podría ser algo así:
Código PHP:
function noAcepto(e) {
    
invalido='%&$';
    
tecla=(document.all) ? e.keyCode e.which;
    
tecla=String.fromCharCode(tecla);
    if (
invalido.indexOf(tecla)!=-1) return false;

Y el campo de texto:

<input type="text" onkeypress="return noAcepto(event)">

Si no he metido la pata en algún sitio funcionará en NS y en IE. Saludos,