Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/05/2005, 07:42
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 h@llo

Prueba esta función, sirve para IE y Firefox:
Código PHP:
function validar(e) {
    
tecla = (document.all) ? e.keyCode e.which;
    if (
tecla==8) return true//Tecla de retroceso (para poder borrar)
    
patron =/[A-Za-z]/;
    
te String.fromCharCode(tecla);
    return 
patron.test(te); 

Tienes que llamarla con:

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

Saludos,