function fchkfrm() { var sErr = ""; if (document.fContactUs.sForename.value=="") { sErr += "\n - Name"; } var emailcheck = fCheckEmail(document.fContactUs.sSenderEmail.value); if (document.fContactUs.sSenderEmail.value=="") { sErr += "\n - Email"; } if (emailcheck == 'invalid') { sErr += "\n - Email is invalid"; } if (document.fContactUs.sTel.value=="") { sErr += "\n - Tel"; } if (document.fContactUs.sEmailMessage.value=="") { sErr += "\n - Enquiry"; } if(!$("#bContactPage_PrivacyPolicy").is(":checked")) { sErr+="\n - Please tick the Privacy Policy box to confirm you've read our Privacy Policy before continuing."; } if (sErr!="") { alert("Please complete the following information:\n" + sErr); } else { $('#contact-recaptcha-modal').modal("show"); // document.fContactUs.submit(); /* dhtmlmodal.open('boxCaptcha', 'div', 'divCaptcha', '', 'width=500px,height=400px,center=1,resize=0,scrolling=1'); document.fCaptcha.sForename.value=document.fContactUs.sForename.value; document.fCaptcha.sSenderEmail.value=document.fContactUs.sSenderEmail.value; document.fCaptcha.sTel.value=document.fContactUs.sTel.value; document.fCaptcha.sEmailMessage.value=document.fContactUs.sEmailMessage.value; if(document.fContactUs.bOptin.checked==true){ document.fCaptcha.bOptin.value='1'; }else{ document.fCaptcha.bOptin.value='0'; } */ } } var widget1; $('#submit-modal').click(function() { if (grecaptcha.getResponse(widget1) != '') { $('#fContactUs').submit(); } else { alert("Please tick I'm not a robot."); } });