![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
25/06/2004, 20:08
|
![Avatar de Mickel](http://static.forosdelweb.com/customavatars/avatar20289_2.gif) | | | Fecha de Ingreso: mayo-2002 Ubicación: Lima, Peru
Mensajes: 4.619
Antigüedad: 22 años, 8 meses Puntos: 7 | |
combinando ambos en una funcion tendrias esto
function ValidarNumero(campo) {
i=1;
if (campo.value=="") {
campo.value=0;
i=0;
}
if (isNaN(campo.value)) {
campo.value=0;
i=0;
}
if (i>0) {
return true;
} else {
alert('Error...');
return false;
}
}
y puedes llamar a esta funcion desde el onBlur del texto con onBlur='ValidarNumero(this);' por ejemplo |