<html>
<head>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</head>
<body>
<h4>Recaptcha test</h4>
<div class="g-recaptcha" data-sitekey="<enter site key here>"></div><br>
<div id="button">
<form method="post" action='Form.asp'>
<input id="sell_house_submit" type="submit" name="submit" value="Try me out!!" onclick="return callValidation();">
</form>
</div>
<script type="text/javascript">
function callValidation(){
if(grecaptcha.getResponse().length == 0){
alert('Please click the reCAPTCHA checkbox');
return false;
}
return true;
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<script src="http://1000hz.github.io/bootstrap-validator/dist/validator.js"></script>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="well">
<form data-toggle="validator">
<div class="form-group">
<input type="text" name="foo" class="form-control" required>
</div>
<div class="form-group">
<div class="g-recaptcha" data-callback="verifyRecaptchaCallback" data-expired-callback="expiredRecaptchaCallback" data-sitekey="<Your Site Key>"></div>
<p> <div class="g-recaptcha" data-sitekey="site key"></div></p>
<input type="hidden" class="form-control" data-recaptcha="true" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</body>
</html>
You must go to the Google reCaptcha website and register your domain and get a data site-key
https://www.google.com/recaptcha/
* Need to first edit this page: c:\Windows\web\RDWeb\Pages\en-US\login.aspx
This page needs a few customizations
Search for <HTMLMainContent> and add the following lines after it
<HTMLMainContent>
<script src="https://www.google.com/recaptcha/api.js"></script>
<script type="text/javascript">
function callValidation(){
if(grecaptcha.getResponse().length == 0){
alert('Please click the reCAPTCHA checkbox');
return false;
}
return onLoginFormSubmit();
return true;
}
</script>
Search for this piece of code.
<form id="FrmLogin" name="FrmLogin" action="login.aspx<%=SecurityElement.Escape(strReturnUrl)%>" method="post" onsubmit="return onLoginFormSubmit();">
Change onLoginFormSubmit to callValidation
<form id="FrmLogin" name="FrmLogin" action="login.aspx<%=SecurityElement.Escape(strReturnUrl)%>" method="post" onsubmit="return callValidation();">
Search for this line of code. Easiest to do a search for this phrase: btnSignIn
<td align="right"><label><input type="submit" class="formButton" id="btnSignIn" value="<%=L_SignInLabel_Text%> " /></label>
Immediately after this line, add this line
(Enter your site key that you got from the Google reCaptcha website)
<div class="g-recaptcha" data-sitekey="ENTER YOUR GOOGLE SiteID here"></div>
Save your file. Now you must do the next step
To ensure all the browsers (especially IE and EDGE) work, you must change the default compatability mode from IE 9 standards to IE 11.
** If you do not, reCaptcha will hang and not work in IE and EDGE
* Edit this file: c:\windows\web\RDWeb\Pages\Site.xsl
Search for this line. Easiest to search for phrase IE=9
Change IE=9 to IE=11
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
Save your file. This should now work for you in all browsers