Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/06/2007, 10:14
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.........


Así.

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;
  } 
 }

Y lo usas
Código PHP:
<input name="txt_rut" maxlength=8 size=8 tabindex=1 onkeypress="return validar(false,this,event);" /> 
Creo que así te entendí... osea, reusar tu funcion validar... ahí lo tienes... y crossbrowser.......... q[]p



connection closed.
__________________

Maborak Technologies