
function validateForm(form) { //This is the name of the function
  var pw1=document.form1.email1.value;
  var pw2=document.form1.email2.value;
 
 
  if (form.fname.value == "") { 
   alert("First name is required."); 
   form.fname.focus( ); 
   return false; 
   }
 
 if (form.lname.value == "") { 
   alert("Last name is required."); 
   form.lname.focus( ); 
   return false; 
   }
   
             if (form.address.value == ""){ 
   alert("Address is required."); 
   form.address.focus( ); 
   return false; 
   }
   
            if (form.city.value == ""){ 
   alert("City is required."); 
   form.city.focus( ); 
   return false; 
   }
   
            if (form.state.value == ""){ 
   alert("State is required."); 
   form.state.focus( ); 
   return false; 
   }
               if (form.zip.value == ""){ 
   alert("Zip code is required."); 
   form.zip.focus( ); 
   return false; 
   }
   
   if (form.email1.value == ""){ 
   alert("Email is required."); 
   form.email1.focus( ); 
   return false; 
   }
     if (form.email2.value == ""){ 
   alert("Please confirm email."); 
   form.email2.focus( ); 
   return false; 
   }
   

    
   

   if ((form.email1.value.indexOf('@') == -1)||(form.email1.value.indexOf('.') == -1)){ 
   alert("Email is wrong."); 
   form.email1.focus( ); 
   return false; 
   }
   if (pw1 != pw2) {
	alert("Please enter the same email"); 
   form.email2.focus( ); 
   return false; 
   }
   
      if (form.phone.value == ""){ 
   alert("Phone is required."); 
   form.phone.focus( ); 
   return false; 
   }

              if (form.occupation.value == ""){ 
   alert("Occupation is required."); 
   form.occupation.focus( ); 
   return false; 
   }
               if (form.employer.value == ""){ 
   alert("Employer/School Attending is required."); 
   form.employer.focus( ); 
   return false; 
   }
   
   
// you may copy the above 5 lines for each form field you wish to validate
// Replace the text "FIELD1" with the name you wish to call the field
}