Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/01/2006, 04:18
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Hola Mari

Creo que sería más sencillo hacerlo de esta forma:
Código PHP:
<html>
<
head>
<
script type="text/javascript">
function 
validar(e) {
    
tecla = (document.all) ? e.keyCode e.which;
    if (
tecla==8) return true;
    
patron =/[A-Za-z&#225;éíóúÁÉÍÓÚ]/;
    
te String.fromCharCode(tecla);
    return 
patron.test(te); 

</script>
</head>

<body>
<p><input type="text" onkeypress="return validar(event)" />
</body>
</html> 
Saludos,