function CheckForm () {
//Initialise variables
var errorMsg = "";
//Check for a first name
if (document.frmEnquiry.Fname.value == ""){
errorMsg += "\n\Fname \t- Please enter your First Name";
}
//Check for a last name
if (document.frmEnquiry.Lname.value == ""){
errorMsg += "\n\Lname \t- Please enter your Last Name";
}
//Check for a phone number
if (document.frmEnquiry.Phone.value == ""){
errorMsg += "\n\Phone \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 Address \t- Please enter a valid e-mail 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 problem(s) 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;
}
