//function to check empty fields//function isEmpty(first_name, last_name, email) {function isEmpty(form) {//change "field1, field2 and field3" to your field namesalert('inside isEmpty()');first_name = document.form.element[0].value last_name = document.form.element[1].valueemail = document.form.email.value  //name field    if (first_name == "" || first_name == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')    {    alert("\"Field 1\" is a mandatory field.\nPlease amend and retry.")    return false;    }  //url field     if (last_name == "" || last_name == null || last_name.charAt(0) == ' ')    {    alert("\"Field 2\" is a mandatory field.\nPlease amend and retry.")    return false;    }  //title field     if (email == "" || email == null || email.charAt(0) == ' ')    {    alert("\"Field 3\" is a mandatory field.\nPlease amend and retry.")    return false;    }    return true;}//function to check valid email address//function isValidEmail(strEmail){function isValidEmail(form){  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;  strEmail = document.form.email.value;   // search email text for regular exp matches    if (strEmail.search(validRegExp) == -1)    {      alert('A valid e-mail address is required.\nPlease amend and retry');      return false;    }     return true; }//function that performs all functions, defined in the onsubmit event handlerfunction check(form)){//if (isEmpty(contactForm.)){//  if (isEmpty(form.field2)){//    if (isEmpty(form)){		if (isValidEmail(form)){		  if(isEmpty(form)){		  return true;		}	  }return false;}