// JavaScript Document function doCheck(form) { var strOpening = "You must complete the following mandatory fields:\n\n"; var strMsg = strOpening; // Personal details if (trim(form.Name.value) == "") { strMsg = strMsg + "* Your name\n"; } if (trim(form.Position.value) == "") { strMsg = strMsg + "* Your position at school\n"; } if (trim(form.Email1.value) != trim(form.Email2.value)) { strMsg = strMsg + "* Both email addresses must match\n"; } else { if (!validateEmail(form.Email1.value)) { strMsg = strMsg + "* Valid email address\n"; } } if (trim(form.Alternate.value) == "") { strMsg = strMsg + "* Phone number\n"; } if (trim(form.SchoolName.value) == "") { strMsg = strMsg + "* School name\n"; } if (trim(form.Address1.value) == "") { strMsg = strMsg + "* School address\n"; } if (trim(form.Suburb.value) == "") { strMsg = strMsg + "* Suburb\n"; } if (trim(form.Postcode.value) == "") { strMsg = strMsg + "* Postcode\n"; } if (trim(form.State.value) == "") { strMsg = strMsg + "* State\n"; } // Check for validation errors if (strMsg == strOpening) { strMsg = ""; } // Terms and conditions if (form.Agree.checked == false) { strMsg = strMsg + "\nYou must agree to the Terms and Conditions before registering.\n"; } // Message if (strMsg == "") { form.Submit.value="Processing..."; return true; } else { alert (strMsg); return false; } }