// JavaScript Document

function fnCheck()
{
	if(name.value.length<2) // checking that this is not blank & is more than 2 characters in length
		{
			alert("Please enter your name. It must contain more than two characters.");
			name.focus();
			return false;
		}
		
	if(email.value.indexOf("@")==-1 || email.value.indexOf(".")==-1 || ema.value==("")) /*checking if the email has an @ sign, a . and has no spaces or is blank */
		{
			alert("You must enter a correct email address.");
			email.select();
			return false;
		}
		
	if(ph.value.length<8) //checking if phone # is more than one character in length 
		{
			alert("Please enter a contact number.");
			ph.focus();
			return false;
		}	
		
	return true;
}





var formX = document.getElementById("form_contact");
var name = document.getElementById("txtName");
var email = document.getElementById("txtEmail");
var ph = document.getElementById("txtPh");



document.getElementById("txtName").focus();



formX.onsubmit = fnCheck;