![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
17/01/2011, 18:50
|
![Avatar de goteen_mx](http://static.forosdelweb.com/customavatars/avatar95811_1.gif) | | | Fecha de Ingreso: abril-2005 Ubicación: D.F.
Mensajes: 403
Antigüedad: 19 años, 10 meses Puntos: 37 | |
Respuesta: Validar Formulario Yo creo que además de lo de Isabel un type para que puedas validar que sea radio, checkbox o tex etc etc
var msj="";
if(f[i].type=="text"){
if(f[i].value=="")
msj+="falta llenar "+ f[i].name
}
if(f[i].type=="radio"){
var prendidoTmp=0;
for(j=0;j<document.getElementsByName(f[i].name).length;j++){
if (document.getElementsByName(f[i].name[j].checked){
prendidoTmp=1;
break;
}
}
if(prendido==0)
msj+= "falta seleccionar f[i].name"
}
if(mjs.length){
alert(msj)
return false;
}
faltan los demas como checkbox, select, textarea
Salu2. |