
function validator1(theForm)
{

  if (theForm.name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.name1.focus();
    return (false);
  }

  if (theForm.name1.value.length < 1)
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.name1.focus();
    return (false);
  }
  
  if (theForm.phone1.value == "")
  {
    alert("Please enter a value for the \"Telephone No\" field.");
    theForm.phone1.focus();
    return (false);
  }

  if (theForm.email1.value == "")
  {
    alert("Please enter valid email in the \"Email\" field.");
    theForm.email1.focus();
    return (false);
  }

  if (theForm.email1.value.length < 1)
  {
    alert("Please enter valid email in the \"Email\" field.");
    theForm.email1.focus();
    return (false);
  }
  
  if(!IsEmail(theForm.email1,'Please enter valid email'))
  {
    return false;
  }
  
   if (theForm.feedback.value == "")
  {
    alert("Please select Feedback Reference.");
    theForm.feedback.focus();
    return (false);
  }
  
  return (true);
}
function IsEmail(fld,msg)
{
	var regex = /^[\w]+(\.[\w]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/ ;
	if(!regex.test(fld.value))
	{
		alert(msg);
		fld.focus();
		return false;
	}
	return true;
}
