Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/06/2006, 08:15
angeles804
 
Fecha de Ingreso: abril-2006
Ubicación: mexico
Mensajes: 287
Antigüedad: 18 años, 1 mes
Puntos: 2
Exclamación diganme cual es el error en esta validación.

Código HTML:
function esInteger(e){
	var charCode
		if (navigator.appName == "Netscape")
		{
			charCode = e.which
		}
		else
		{
			charCode = e.keyCode
		} 
		if (charCode < 48 || charCode > 57)
		{
			alert("Por favor teclee solo números en este campo!"); 
			return false;
		}
		else
		{
			return true;
		}
}
y luego voy a poner en el donde valido, pero no funciona y me marca un error.
Código HTML:
 <td><input name="txtdiab" type="text" id="txtdiab" size="2" maxlength="2" value="<?php echo $diab;?>" keypress="return esInteger(txtdiab)">
          <span class="Estilo9">/
          <input name="txtmesb" type="text" id="txtmesb" size="2" maxlength="2" value="<?php echo $mesb;?>" keypress="return esInteger(txtmesb)">
          /</span> <input name="txtanob" type="text" id="txtanob" size="4" maxlength="4" value="<?php echo $anob;?>" keypress="return esInteger(txtanob)">