
<!-- Hide from older browsers
//Check the enquiry form is filled in correctly
function CheckForm () { //Initialise variables
var errorMsg = "";
//Check for a company name
if (document.frmEnquiry.company.value == ""){
errorMsg += "\n\tCompany Name \t- Enter your Company Name"; }
//Check for a postcode
if (document.frmEnquiry.postcode.value == ""){
errorMsg += "\n\tCompany Postcode \t- Enter your Company Postcode"; }
//Check for a contact telephone number
if (document.frmEnquiry.telephone.value == ""){
errorMsg += "\n\tTelephone Number \t- Enter your Booking Contact Telephone Number"; }
//Check for a contact first name
if (document.frmEnquiry.firstName.value == ""){
errorMsg += "\n\tFirst Name \t- Enter your Booking Contact First Name"; }
//Check for a contact last name
if (document.frmEnquiry.lastName.value == ""){
errorMsg += "\n\tLast Name \t- Enter your Booking Contact Last Name"; }
//Check for a course name
if (document.frmEnquiry.course.value == "Choose a Course:"){
errorMsg += "\n\tCourse Title \t- Enter your chosen Course Title"; }
//Check for payment options
if (document.frmEnquiry.payment.value == "Choose an option:"){
errorMsg += "\n\tpayment \t- Enter your chosen payment option"; }
//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\tE-mail Address \t- Enter your valid e-mail address";
}
//If there is aproblem with the form then display an error
if (errorMsg != ""){
msg = "______________________________________________________________\n\n";
msg += "Your provisional booking has 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;
}
// -->
