function validateForm(Qform){
var i=0,Q= Qform.elements,L=Q.length;
for (var a = 0; a < L; a++){
var field = Q[a];
if(field.value==='' && field.type=='text'){
field.style.backgroundColor= 'red';
++i;
}
}
if(i) {
alert('You must provide values for all the fields');
return false;
}
return true;
}
function validateForm(Qform){
var i=0,Q= Qform.elements,L=Q.length;
for (var a = 0; a < L; a++){
var field = Q[a];
if(field.value===''){
field.style.backgroundColor='red';
++i;
}
else field.style.backgroundColor='';
}
if(i){
alert('You must provide values for all the fields');
return false;
}
return true;
}