
function checkLogin() {
owner = "Western Tooling\nOnline form validation";
missinginfo = "";

if (document.form1.Reason_for_contact.selectedIndex == 0){
missinginfo += "\nthe reason for contacting us\n";
}
if (document.form1.Contact_name.value == "" ) {
missinginfo += "\nyour name";
}
if (document.form1.Contact_telephone.value == "" ) {
missinginfo += "\nyour telephone number";
}
if (document.form1.Call_back_options.selectedIndex == 0){
missinginfo += "\nthe best time to ring you";
}

if (document.form1.Contact_email.value == "" ) {
missinginfo += "\nyour email address";
}

if (document.form1.Address.value.length < 5) {
missinginfo += "\n\nyour postal address\n(minimum entry = FULL POSTCODE)";
}

if (missinginfo != "") {
missinginfo =owner + "\n\nPROBLEM!!\nYou failed to provide:\n" +
missinginfo + "\n\nPlease provide the missing information!";
alert(missinginfo);
return false;
}
else
{
missinginfo =owner + "\n" +
"\nThank you for completing all the required information\n\nNow click OK to send your information.";
alert(missinginfo);
}

return true;
}

