Zoho forms google recaptcha v2
Hi,
Here i’m going to discuss about Zoho forms google recaptcha v2. Google is best in providing services up to the standards because of its access to the billions of users and their behviour analysis. Their reCaptcha service works on the server based technology. It keeps on checking IP address if it finds spam, then it will ask for captcha verification, otherwise will let you tick the check box and pass the form.
What is Google reCaptcha in simple words
CAPTCHA is an acronym which stands for Completely Automated Public Turing Test to Tell Computers and Humans Apart.The most common form of CAPTCHA is an image of distorted letters or selection of visual images which robot can’t differentiate. So while using CAPTCHA the goal is to create a test which can only be passed by humans. Most of the CAPTCHA use visual images for the test.
<script src='https://www.google.com/recaptcha/api.js'></script>
if this code area is like a chaos or you’re facing problem in code insertion then you can also add this code in the header.php file just before the closing head tag </head>.
Step 3: Insert this html code in the zoho form where you want to show the google recaptcha
<div class="g-recaptcha" data-sitekey="your-SiteKey" data-callback="verifyCaptcha"></div> <div id="g-recaptcha-error"></div>
Step 4: Write this function inside the script tag where other zoho form validation functions are specified.
function validateRecaptcha()
{
var response = grecaptcha.getResponse();
if(response.length == 0) {
document.getElementById('g-recaptcha-error').innerHTML = 'This field
is required.';
return false;
}
return true;
}
function verifyCaptcha() {
document.getElementById('g-recaptcha-error').innerHTML = '';
}
Step 5: Add this code at the end of your main form validation function named checkMandatoryxxxxxxxxxxxxx()
if(validateRecaptcha()==1) return ture; else return false;
Note: It is possible that your zoho form validation function checkMandatoryxxxxxxxxxxxxx() has different numbers with its name. That’s why i’m using the xxxxxxx in the place of numbers. Keep in mind this number is the same number which is in your zoho form id, and different form has different form id. So don’t worry about it.
Step 6: Call the checkMandatoryxxxxxxxxxxxx() function in form onSubmit event like this:
<form action='www.example.com' method='POST' onSubmit='javascript:document.charset="UTF-8"; return checkMandatory();' accept-charset='UTF-8'>
Notes: If you want to get our services in embedding Google reCaptcha, then Contact Us