// JavaScript Document
<!-- Javascript Form Validations Begins here -->



function do_submit()
{
  // check for blank values---------------------------  
  if(document.frm.Name.value =="")
  {
    alert("Please enter Name.");
    document.frm.Name.focus();  
    return false;
  }
  if(document.frm.Email.value =="")
  {
    alert("Please enter EmailId.");
    document.frm.Email.focus();  
    return false;
  } 
   if(document.frm.Phone.value =="")
  {
    alert("Please enter Phone Number.");
    document.frm.Phone.focus();  
    return false;
  }  
  /*  if(!checkspace(document.frm.Name.value))
  {
	alert("Please do not use space in Name");
	document.frm.Name.focus();
	return false;
  }	*/
  if(!IsEmailValid(document.frm.Email.value))
  {
	alert("Please enter the email correctly.");
	document.frm.Email.focus();
	return false;
  }
  
    return true;          //submit the form now
}
/// Function to eliminate space in UserID Field	
	function checkspace(val)
	{
		if(val.indexOf(" ")!= -1)
		{
			return false
		}
		return true
	}
	/// Function to eliminate space in UserID Field ends here.

//Function to check the valid Email ID
	   function IsEmailValid(tocheck){
			var AtSym1  = tocheck.indexOf("\@");
			if (AtSym1 == -1 || AtSym1 == 0 || AtSym1 == tocheck.length-1)
			{
				return false
			}
			var AtSym2   = tocheck.lastIndexOf('.');
			if (AtSym2 == -1 || AtSym2 == 0 || AtSym2 == tocheck.length-1)
			{
				return false
			}
			if (AtSym1 >= AtSym2 )
				{
				return false
			}

			var Amp_count=0;
			var j=0;
			for(j=0;j<tocheck.length;j++)
			{
				if(tocheck.substring(j,j+1) == "\@") Amp_count=Amp_count+1;
				if(tocheck.substring(j,j+1)==' ') return false
			  }
			if(Amp_count > 1) return false
			return true
	 }

	///  Validation of email ID Ends here
