// JavaScript Document 
function checkForm1() {
  if (document.frmContact.txt_name.value =="") {
   alert("Your name please!");
   document.frmContact.txt_name.focus();
   return (false);
   }
  if (document.frmContact.txt_adds.value =="") {
   alert("Your address please!");
   document.frmContact.txt_adds.focus();
   return (false);
   }  
  if (document.frmContact.txt_email.value =="") {
   alert("Your valid email address please!");
   document.frmContact.txt_email.focus();
   return (false);
   }
 <!-------------------txt_email validation---------------------->
  if (document.frmContact.txt_email.value !="") 
	   {
		var str=document.frmContact.txt_email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("E-mail ID must be in proper format!");
		   document.frmContact.txt_email.focus();
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("E-mail ID must be in proper format!");
		   document.frmContact.txt_email.focus();
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			alert("E-mail ID must be in proper format!");
			document.frmContact.txt_email.focus();
			return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
			alert("E-mail ID must be in proper format!");
			document.frmContact.txt_email.focus();
			return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			alert("E-mail ID must be in proper format!");
			document.frmContact.txt_email.focus();
			return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
			alert("E-mail ID must be in proper format!");
			document.frmContact.txt_email.focus();
			return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
			alert("E-mail ID must be in proper format!");
			document.frmContact.txt_email.focus();
			return false;
		 }
	   }
 <!-------------------------end of txt_email validation-------------->
  if (document.frmContact.txt_message.value =="") {
   alert("Reason (query) of contact please!");
   document.frmContact.txt_message.focus();
   return (false);
   }
  return true;
}
