Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/01/2007, 04:00
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 23 años
Puntos: 772
Re: La misma función para tres diferente objetos

Hola emont

Puedes hacer algo así:

<input type="text" name="dia" onblur = "validar(this)" />
<input type="text" name="mes" onblur = "validar(this)" />

y usar este código:
Código:
function validar(obj) {
  if (isNaN(obj.value)) {
    obj.value='';
    obj.focus();
  }
}
Saludos,