

function checkRequired(){
	var userInputName=document.getElementById("appt-name");
	var userInputPhone=document.getElementById("appt-phone");
	var userInputEmail=document.getElementById("appt-email");
	
	var phoneRegexStr = /^\(?(\d{3})\)?[- \.]?(\d{3})[- \.]?(\d{4})$/;
	var emailRegexStr = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;

	
//check if valid name
	if(userInputName.value=="Last Name, First Name" || userInputName.value==""){
		alert("Please enter the name of the person to be contacted.");
		userInputName.focus();
		return false;
	}
	
//check if valid phone number
	else if(!phoneRegexStr.test(userInputPhone.value) || (userInputPhone.value=="Telephone Number" || userInputPhone.value=="")){
		alert("Please enter a valid phone number - example: (555) 555-1212");
		userInputPhone.focus();
		return false;
	}
	
//check if valid email address
	else if(!emailRegexStr.test(userInputEmail.value) || (userInputEmail.value=="Email" || emailTxt.value=="")){
		alert("Please enter a valid email address - example: name@domainname.com");
		userInputEmail.focus();
		return false;
	}
	return true;
}
