function isEmpty(strfield1) {
 
 
//change "field1, field2 and field3" to your field names
strfield1 = document.forms[0].name.value 
 
  //name field
    if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')
    {
    alert("Please Enter Your Name Before Continuing")
	document.forms[0].name.focus();
    return false;
    }    
    return true;
}
 
//function to check valid email address
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.forms[0].email.value;
 
   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      alert('Please enter a valid e-mail address before continuing.\nPlease amend and retry');
	  document.forms[0].email.focus();
      return false;
    } 
    return true; 
}
 
//function that performs all functions, defined in the onsubmit event handler
 
function check(form){
if (isEmpty(form.name)){
		if (isValidEmail(form.email)){
		  return true;
		}
}
return false;
}
 