![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
22/07/2006, 10:10
|
![Avatar de Cap.Buscapina](http://static.forosdelweb.com/customavatars/avatar76796_1.gif) | | | Fecha de Ingreso: octubre-2004 Ubicación: Argentina
Mensajes: 836
Antigüedad: 20 años, 4 meses Puntos: 4 | |
la funcion: Cita: function validar(e,v) {
tecla = (document.all) ? e.keyCode : e.which;
if (tecla==8) return true;
patron =/[0-9\.\s]/;
te = String.fromCharCode(tecla);
if(v.indexOf(".")!=-1 && te=="."){
return false;
}
return patron.test(te);
} y el input: Cita: <input name="Ancho1" id="Ancho1" type="text" size="6" maxlength="5 "onkeypress="return validar(event,this.value)" > saludos
__________________ by Capitán Buscapina
. |