function CheckForm () {
//Initialise variables
var errorMsg = "";
//Check for a name
if (document.frmEnquiry.Name.value == ""){
errorMsg += "\n\Name \t- Please enter your Name";
}
//Check for a phone number
if (document.frmEnquiry.Phone.value == ""){
errorMsg += "\n\Phone Number \t- Please enter your Phone Number";
}
//Check for an e-mail address and that it is valid
if ((document.frmEnquiry.Email.value == "") || (document.frmEnquiry.Email.value.length > 0 && (document.frmEnquiry.Email.value.indexOf("@",0) == - 1 || document.frmEnquiry.Email.value.indexOf(".",0) == - 1))) {
errorMsg += "\n\Email \t- Please enter a valid Email Address";
}
//If there is aproblem with the form then display an error
if (errorMsg != ""){
msg = "______________________________________________________________\n\n";
msg += "Your inquiry can not been sent because there are problems with the form.\n";
msg += "Please correct the problem(s) and re-submit the form.\n";
msg += "______________________________________________________________\n\n";
msg += "The following field(s) need to be corrected: -\n";
errorMsg += alert(msg + errorMsg + "\n\n");
return false;
}
return true;
}
