function checkFormRecaptcha() { /* Check Captcha */ var challenge = document.getElementsByName("recaptcha_challenge_field")[0].value var resp = document.getElementsByName("recaptcha_response_field")[0].value; var PostStr = "privkey=6Ldbg-0SAAAAAKDQY8cRapT_jPjmCMH_o1ftJzok&recaptcha_challenge_field="+challenge+"&recaptcha_response_field="+resp; var returncaptcha = false $.ajax({ type:'POST', async:false, url:'template/valrecaptcha.asp', data:PostStr, dataType:'html', success:function(data) { if (data == "PASS") { returncaptcha = false } else { returncaptcha = true } } }); if (returncaptcha == true) { alert("Captcha Failed. Please try again ..."); Recaptcha.reload(); return false; }else { return true; //alert("Captcha Passed ..."); } /* Check Captcha */ } function checkFormRecaptchaNew() { var recaptchaResponse = grecaptcha.getResponse(); var good = false $.ajax({ type: "POST", async: false, url: "verifyrecaptcha.asp", data: {secret:'6Ldbg-0SAAAAAKDQY8cRapT_jPjmCMH_o1ftJzok', response:recaptchaResponse, remoteip:'162.158.79.119'}, success: function (result) { if(result == "true") { good = true; } else { good = false; } } }); if(!good) { alert("Please confirm you are not a robot."); } return good; }