Ver Mensaje Individual
  #7 (permalink)  
Antiguo 28/06/2007, 13:11
Avatar de MaBoRaK
MaBoRaK
 
Fecha de Ingreso: abril-2003
Ubicación: La Paz - Bolivia
Mensajes: 2.003
Antigüedad: 21 años, 9 meses
Puntos: 35
Re: problemas con funcion solo numeros

loading....................


Código PHP:
var validar=function(formulario,validarCampo,evt)
{
if(
validarCampo)
{
   
evt evt || window.event;
   var 
cdevt.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.
__________________

Maborak Technologies