![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
17/11/2013, 13:36
|
| | Fecha de Ingreso: junio-2008
Mensajes: 291
Antigüedad: 16 años, 7 meses Puntos: 9 | |
Respuesta: saber si todo el formulario esta vacio Solucionado!!
function validate(){
var fields = new Array;
var fields = [document.getElementById('autor'),document.getEleme ntById('titulo')];
var err = 0;
for (i=0;i<fields.length;i++){
if (fields[i].value == ""){
err++;
}
}
if (err === 0){
//Submit Form
document.myform.submit();
//document.getElementById('alerta').style.display="n one";
}else {
document.getElementById('alerta').style.display="b lock";
//alert("Please Fill Out All Of The Fields");
return false;
}
} |