![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
06/08/2008, 12:46
|
![Avatar de foreverOdd](http://static.forosdelweb.com/customavatars/avatar203712_2.gif) | | | Fecha de Ingreso: noviembre-2007 Ubicación: Caracas
Mensajes: 489
Antigüedad: 17 años, 2 meses Puntos: 14 | |
Respuesta: como restringir este caracter < en un textarea aqui me encontre esto en una pagina
<input name="cedula" type="text" id="cedula" value="" onkeypress="return validar(event)" maxlength="8" />
<script>
function validar(e) { // 1
tecla = (document.all) ? e.keyCode : e.which; // 2
if (tecla==8) return true; // 3
//patron =/[0-9]/; // 4
patron =/[<]/;
te = String.fromCharCode(tecla); // 5
return !patron.test(te); // 6
}
</script>
esto te impide que introduscas <
los caracteres que no quieres que sean introducidos ponlo entre los [] o corchetes, deberia funcionar si lo haces con un textarea
__________________ My path is lit by my own fire, I only go where I desire |