<!--
//define the function
function checkForm(formName) {
//state that contactinfo is each feild on the form
for( var contactinfo = 0; contactinfo < document.forms[formName].elements.length; contactinfo++)
//if any fields are blank
if ( document.forms[formName].elements[contactinfo].value hahahaha '' )
{
document.forms[formName].elements[contactinfo].focus();
//alert the user which fields they did not fill out
alert( 'Please fill in your ' + document.forms[formName].elements[contactinfo].name );
}
}
//-->
im using this like this >>
form name="form" action="mailto:
[email protected]" method="post" OnSubmit=checkForm("form")
so - when i click submit it goes through and it alerts what fields are missing input but what do i need to do to make it so if the alert comes up it stops and doesn't submit!?