Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/07/2012, 19:43
leonardo308
 
Fecha de Ingreso: noviembre-2010
Mensajes: 42
Antigüedad: 13 años, 4 meses
Puntos: 2
Exclamación No Valida BIEN!!!!!

No puedo solucionar este problemas que ya no se que intentar para resolverlo a travez de EXPRESION REGULAR no quiero por el numero de tecla sino solo por la expresion regular q me Acepte Ñ y que no se escriban los numeros por el keypad del teclado.

en otras palabras PORQUE NO ME ACEPTA Ñ
Y PORQUE ME ACEPTA LOS NUMEROS DEL KEYPAD?????????????????????
ayudaaaaaaaaaaaa....

Código:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>validar</title>
</head>

<body>
<script>
function validar(e){
	var exp=/[a-zA-ZñÑ\s]/;
	return exp.test(String.fromCharCode(e.which));
}
</script>
 <input type="text" id="campo_de_prueba2" name="textfield" onKeyDown="return validar(event)" />
</body>
</html>