loading....................
Código PHP:
var validar=function(formulario,validarCampo,evt)
{
if(validarCampo)
{
evt = evt || window.event;
var cd= evt.which || evt.keyCode;
return (cd<45 || cd >57)?false:true;
}
else
{
if (formulario.txt_rut.value == null || formulario.txt_rut.value == "")
{
alert("Ingrese Rut Postulante");
formulario.txt_rut.focus();
return false;
}
valor=parseInt(formulario.txt_rut.value);
if (isNaN(valor))
{
alert("Debe ingresar solo numeros");
formulario.txt_rut.focus();
return (false);
}
}
}
Y lo usas
Código PHP:
<input name="txt_rut" maxlength=8 size=8 tabindex=1 onkeypress="return validar(false,this,event);" />
cuida tu ortografía.
connection closed.