The code is below.
The way I had set it up was that the form's Submit button is disabled by default. And if the user submits the correct CAPTCHA, the Submit button gets enabled (via jQuery/Javascript).
It used to work fine. And then one morning in end-May 2015 or early-June 2015, it stopped working.
Suggestions?
<html>
<head>
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<form action="create_rb.php" method="post">
Text Field: <input type="text" size="40" name="name"><br>
<div id='html_element'></div>
<br/>
<input type="submit" class="button-primary" value="Submit" id="submitButton" style="height:50px; width:200px" disabled>
</form>
<script type="text/javascript">
var correctCaptcha = function(response) { //http://stackoverflow.com/questions/27902539/how-can-i-validate-google-recaptcha-v2-using-javascript-jquery
var response = grecaptcha.getResponse();
if(response.length != 0) { //reCaptcha verified
$('#submitButton').removeAttr('disabled');
}
};
var onloadCallback = function() {
grecaptcha.render('html_element', {
'sitekey' : 'my-site-key',
'callback' : correctCaptcha
});
};
</script>
</body>
</html>