Hi Everyone
I have a form validation function that loops through the form elements checking for empty fields - code below:
function formValidate(ourform){
var formelems = document.getElementById(ourform).elements;
for (var i=0; i<formelems.length; i++){
if(formelems[i].value == "") {
alert("Empty Field(s). Please fill in all the fields.");
return false;
}
}
}
the problem is that my form does not return false if there's an empty field - it processes the form. I have solved this before but now i just cannot remember how.
Thanks.