<!--
function check_form(){

//FULL NAME FORMAT: letters only
var fullnameformat = /^\D+\s+\D+$/

//POSTCODE FORMAT: X# #XX
var postcodeformat1 = /^\D{1}\d{1}\s{1}\d{1}\D{2}$/

//POSTCODE FORMAT: X## #XX
var postcodeformat2 = /^\D{1}\d{2}\s{1}\d{1}\D{2}$/

//POSTCODE FORMAT: XX# #XX
var postcodeformat3 = /^\D{2}\d{1}\s{1}\d{1}\D{2}$/

//POSTCODE FORMAT: XX## #XX
var postcodeformat4 = /^\D{2}\d{2}\s{1}\d{1}\D{2}$/

//POSTCODE FORMAT: X#X #XX
var postcodeformat5 = /^\D{1}\d{1}\D{1}\s{1}\d{1}\D{2}$/

//POSTCODE FORMAT: XX#X #XX
var postcodeformat6 = /^\D{2}\d{1}\D{1}\s{1}\d{1}\D{2}$/

//POSTCODE FORMAT: X# #XX (no space)
var postcodeformat1nosp = /^\D{1}\d{1}\d{1}\D{2}$/

//POSTCODE FORMAT: X## #XX (no space)
var postcodeformat2nosp = /^\D{1}\d{2}\d{1}\D{2}$/

//POSTCODE FORMAT: XX# #XX (no space)
var postcodeformat3nosp = /^\D{2}\d{1}\d{1}\D{2}$/

//POSTCODE FORMAT: XX## #XX (no space)
var postcodeformat4nosp = /^\D{2}\d{2}\d{1}\D{2}$/

//POSTCODE FORMAT: X#X #XX (no space)
var postcodeformat5nosp = /^\D{1}\d{1}\D{1}\d{1}\D{2}$/

//POSTCODE FORMAT: XX#X #XX (no space)
var postcodeformat6nosp = /^\D{2}\d{1}\D{1}\d{1}\D{2}$/

//TELEPHONE NUMBER FORMAT: ##### ######
var telephoneformat = /^\d{5}\s{1}\d{6}$/

//TELEPHONE NUMBER FORMAT: ##### ###### (no space)
var telephoneformatnosp = /^\d{11}$/

//EMAIL SUFFIX: .com .net .org
var emailformat1 = /^.+@.+\.\D{3}$/

//EMAIL SUFFIX: .co.uk
var emailformat2 = /^.+@.+\.\D{2}\.\D{2}$/

//EMAIL SUFFIX: .info
var emailformat3 = /^.+@.+\.\D{4}$/

//EMAIL SUFFIX: .com .net .org
var emailformat11 = /^\w+@\w+\.\D{3}$/

//EMAIL SUFFIX: .co.uk
var emailformat22 = /^\w+@\w+\.\D{2}\.\D{2}$/

//EMAIL SUFFIX: .info
var emailformat33 = /^\w+@\w+\.\D{4}$/


//CHECK VALID REQUEST

if (document.frmSubmitCV.message.value == "")
{
alert('Please enter your message');
document.frmSubmitCV.message.focus();
return false;
} //endif


//CHECK VALID FULL NAME

else if (document.frmSubmitCV.name.value.search(fullnameformat) == -1)
{
alert('Please enter your full name');
document.frmSubmitCV.name.focus();
return false;
} //endif


//CHECK VALID POSTCODE

else if (document.frmSubmitCV.postcode.value == "")
{
alert('Please enter your postcode');
document.frmSubmitCV.postcode.focus();
return false;
} //endif


//CHECK VALID POSTCODE FORMAT

else if ((document.frmSubmitCV.postcode.value.search(postcodeformat1) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat2) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat3) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat4) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat5) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat6) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat1nosp) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat2nosp) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat3nosp) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat4nosp) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat5nosp) == -1) && (document.frmSubmitCV.postcode.value.search(postcodeformat6nosp) == -1))
{
alert('Please enter a valid postcode');
document.frmSubmitCV.postcode.focus();
return false;
} //endif


//CHECK VALID METHOD OF CONTACT

else if ((document.frmSubmitCV.telephone.value == "") && (document.frmSubmitCV.telephone2.value == "") && (document.frmSubmitCV.telephone3.value == "") && (document.frmSubmitCV.email.value == ""))
{
alert('Please enter a telephone number or email address');
document.frmSubmitCV.telephone.focus();
return false;
} //endif


//CHECK VALID DAYTIME PHONE NUMBER FORMAT

else if ((document.frmSubmitCV.telephone.value != "") && (document.frmSubmitCV.telephone.value.search(telephoneformat) == -1) && (document.frmSubmitCV.telephone.value.search(telephoneformatnosp) == -1))
{
alert('Please enter a valid daytime telephone number');
document.frmSubmitCV.telephone.focus();
return false;
} //endif


//CHECK VALID EVENING PHONE NUMBER FORMAT

else if ((document.frmSubmitCV.telephone2.value != "") && (document.frmSubmitCV.telephone2.value.search(telephoneformat) == -1) && (document.frmSubmitCV.telephone2.value.search(telephoneformatnosp) == -1))
{
alert('Please enter a valid evening telephone number');
document.frmSubmitCV.telephone2.focus();
return false;
} //endif


//CHECK VALID MOBILE PHONE NUMBER FORMAT

else if ((document.frmSubmitCV.telephone3.value != "") && (document.frmSubmitCV.telephone3.value.search(telephoneformat) == -1) && (document.frmSubmitCV.telephone3.value.search(telephoneformatnosp) == -1))
{
alert('Please enter a valid mobile telephone number');
document.frmSubmitCV.telephone3.focus();
return false;
} //endif


//CHECK VALID EMAIL FORMAT

else if ((document.frmSubmitCV.email.value != "") && (document.frmSubmitCV.email.value.search(emailformat1) == -1) &&(document.frmSubmitCV.email.value.search(emailformat2) == -1) && (document.frmSubmitCV.email.value.search(emailformat3) == -1))
{
alert('Please enter a valid email address');
document.frmSubmitCV.email.focus();
return false;
} //endif


//CHECK VALID PREFERRED METHOD OF CONTACT

else if ((document.frmSubmitCV.option1.selectedIndex == 0))
{
alert('Please select a preferred method of contact from the list provided');
document.frmSubmitCV.option1.focus();
return false;
} //endif


//CHECK VALID PREFERRED METHOD OF CONTACT (MATCH)

else if (((document.frmSubmitCV.option1.value == "Daytime Phone No") && (document.frmSubmitCV.telephone.value == "")) | ((document.frmSubmitCV.option1.value == "Evening Phone No") && (document.frmSubmitCV.telephone2.value == "")) | ((document.frmSubmitCV.option1.value == "Mobile Phone No") && (document.frmSubmitCV.telephone3.value == "")) | ((document.frmSubmitCV.option1.value == "Email Address") && (document.frmSubmitCV.email.value == "")))
{
alert('Please select from the list provided, a preferred method of contact that matches the details you entered');
document.frmSubmitCV.option1.focus();
return false;
} //endif


//CHECK VALID PREFERRED TIME

else if ((document.frmSubmitCV.option2.selectedIndex == 0))
{
alert('Please select a preferred time to contact you from the list provided');
document.frmSubmitCV.option2.focus();
return false;
} //endif

}// end function check_form -->