/* STORE REQUIRED VARIABLES ======================== */ var widget1; /* fEmailMailingList_Submit() ========================== Checks if there are any problems with the form */ function fEmailMailingList_Submit() { // If the grecaptcha is not valid if (grecaptcha.getResponse(widget1) == '') { // Alert response alert("Please tick I'm not a robot."); // Exit function return false; } // Store the error var sErr = ""; // If the name is not valid if( document.fMailingListForm.sName.value =="" ) { // Store the error sErr += "\n - Name"; } // If the email is invalid if ( fCheckEmail(document.fMailingListForm.sEmail.value) == 'invalid') { // Store the error sErr += "\n - Email is invalid"; } // If the privacy policy box is not checked if( !$("#MailingList_PrivacyPolicy").is(":checked") ) { sErr+="\n - Please tick the Privacy Policy box to confirm you've read our Privacy Policy before continuing."; } // If there was an error if (sErr != "") { // Alert the information alert("Please complete the following information:\n" + sErr); } // If there was no error else { // Submit the form $(document.fMailingListForm).submit(); } }