function validate_form() 
{
	validity=true;
	str="Invalid entry"+"\n"; 
	if (check_empty(document.Form.fname.value))
    { validity = false; str=str+"Name";}
	if (!check_email(document.Form.email.value))
    { validity = false; str=str+" "+"Email"; }
    if (check_empty(document.Form.phno.value))
    { validity = false; str=str+" "+"Phone"; }


	if(validity)
	{
		document.Form.submit();
	}
	else
	{
		alert(str);
	}
}

function check_email(address) {
  if ((address == "") || (address.indexOf ('@') == -1) || (address.indexOf ('.') == -1))
      return false;
  return true;
}

function check_empty(text) {
return (text.length<1|| !text.match(/[^\s]/));
}