I'm getting a weird error in Mozilla which I can't seem to find an answer to. Basically, I'm doing some simple form validation before submitting the form. If it fails I want it to stop the submittal process. The code I've got works fine for IE but in Mozilla it flashes the error on-screen with an alert statement but then proceeds to submit the form anyway.

the code is

for (var loop = 0; loop < fields_to_check.length; loop++)
				if (document.forms[form_to_check].elements[fields_to_check[loop]].value == '')
					alert ('You must enter '+field_warnings[loop]+' !');
					return false;
It's the event.returnValue=false statement that stops the form submission but Mozilla seems to ignore it and searching on Google hasn't turned up any answers. All ideas are welcome