
var charexp = /./;


// This function checks that "string" is not empty.  Note: a space is consider
// a valid entry
function hasChar(string) {
	return charexp.test(string);
}

// This function checks that all the form fields are not empty, and creates
// an alert message that tells the user which fields they forgot to complete
function validate(theForm) {
// The variable objForm is a pointer to the form named frmAddress
var objForm=document.frmAddress;

var missingInfo="";
	var f=document.frmAddress;
	var e = f.txtEmail.value;
		
	if(!hasChar(objForm.txtFirstName.value)) missingInfo += "* First Name\n";
	if(!hasChar(objForm.txtLastName.value)) missingInfo += "* Last Name\n";
	if(!hasChar(objForm.txtPhone.value)) missingInfo += "* Phone Number\n";
	if(missingInfo != "")
	{
		alert ("Please go back and enter the following missing information:\n" + missingInfo);
		return false;
	}
}




