// JavaScript Document function doCheck(form) { var strOpening = "You must complete the following mandatory fields:\n\n"; var strMsg = strOpening; // Personal details if (trim(form.FirstName.value) == "") { strMsg = strMsg + "* First name\n"; } if (trim(form.LastName.value) == "") { strMsg = strMsg + "* Last name\n"; } if (trim(form.Address1.value) == "") { strMsg = strMsg + "* Address\n"; } if (trim(form.Suburb.value) == "") { strMsg = strMsg + "* Suburb\n"; } if (trim(form.State.value) == "") { strMsg = strMsg + "* State\n"; } if (trim(form.Postcode.value) == "") { strMsg = strMsg + "* Postcode\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"; } } // 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 subscribing.\n"; } // Message if (strMsg == "") { form.Submit.value="Processing..."; return true; } else { alert (strMsg); return false; } }