// Javascript validation functions
// http://www.designplace.org/
 
 
//function to check empty fields
 
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("\"Name\" is a required field.\nPlease input and retry.")
    return false;
    }
 
 
//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('A valid e-mail address is required.\nPlease correct and retry');
      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;
}