Presiding Officer Training module 2024 lok sabha elections
Adding google re captch in sharepoint 2013
1. Adding Google ReCaptchinSharePoint 2013/2016/2019 andSharePoint online
Google has released a new version of recaptcha, with enhanced security and richer
user experience.
The points below might help to clarify certain instructions to create a ReCaptch in
SharePoint.
Step1: You need a site key and secret key in order to use ReCaptcha in your application.
Step2: You have to generate yourkeysafterregisteryourapplicationURLunderbelow givenURL.
https://www.google.com/recaptcha/admin#list
Step3: For example: My SharePoint online URL is https://RajDev.sharepoint.com soyoumustuse
the same URL to generate the keys.
Step4: For registering URL, go to the above Google URL and click on plus icon as per below
image.
Step5: Enter your label name and choose reCaptchV2 and enter your application URL
excluding https inside domains.
2. Step6: once you enter everything just click on submit and it will give you both site key and
secret key as per below image.
Step7: To integrate inyourHTML clientthe recaptcha script reference mustbe incorporatedinthe
HEAD sectionof the page :
<Script src = 'https: //www.google.com/recaptcha/api.js'> </ script>
Step8: Add your JavaScript code as per below code.
<script>
var onloadCallback = function() {
grecaptcha.render('google_recaptcha', {
'sitekey' : '6LfttpMUAAiAAAEn_Vgui0Amn_4GvM16Di4D4e3z'
});
};
</script>
Step9: You also need to create a method to validate the response recatpcha
Example:
$(document).ready(function ($) {
$('#file_input').MultiFile();
3. $("#fbutton").click(function () {
if(IsValid())
{
if (checkifreqfld()) {
event.preventDefault();
var rcres = grecaptcha.getResponse();
if(rcres.length){
grecaptcha.reset();
finalSave() ;
}else{
showHideMsg("Please verify you are not a robot!","error");
}
}
}
});
});
Here is the HTML code for ReCapctha service.
<div style="margin-left: 10px;">
<div id="google_recaptcha"></div>
</div>
Step10: Finally in the page load, you can able to see your Captcha and for verifying, you
must have click the submit button.