14/09/2006, 12:08
|
| | Fecha de Ingreso: abril-2005 Ubicación: en Santa Cruz - España
Mensajes: 429
Antigüedad: 19 años, 9 meses Puntos: 1 | |
Bueno cchicos le encontre otra solucion parche, pero si alguien sabe como solucionarlo con expresiones regulares seria fantastico!!!
function VerificarNumero(e){
tecla = (document.all) ? e.keyCode : e.which;
if (tecla==8) return true;
patron =/[0-9]/;
te = String.fromCharCode(tecla);
return patron.test(te);
}
function ValidarNumero(texto,maximo){
var valor = new Number(texto.value);
var maxi = new Number(maximo);
if(valor>maxi){
alert("Aviso: Te pasaste del limite");
texto.focus();
}
}
<input name="vf_opcionmultiple" type="text" value="5" size="5" maxlength="5" readonly/>
<input name="vf_cantidad" type="text" size="5" maxlength="5" onKeyPress="return VerificarNumero(event)" onchange="ValidarNumero(this,'5')"/>
chausito |