enable button when reCAPTCHA

enable button when reCAPTCHA

Hi,

I am trying o use reCAPTCHA. I have disabled the button on page load and now I want when the reCAPTCHA is verified to enable the button. I tried below button but it';s not enabling the button!

Kindly help..

  1. <script type='text/javascript'>
  2. var captchaContainer = null;
  3. var loadCaptcha = function() {
  4.   captchaContainer = grecaptcha.render('captcha_container', {
  5. 'sitekey' : '6Lfl9yATAAAAAF1NfR1R5nojGGOIlz7K79NiEoW7',
  6. 'callback' : function(response)
  7. {
  8.  // console.log(response);
  9.  document.getElementById('btnForgotPassword').disabled = true;
  10. }
  11.   });
  12. };
  13. </script>


this is the form:

  1. <form id="frmForgotPassword" name="frmForgotPassword" class="ui-body ui-body-a ui-corner-all">
  2. <fieldset>
  3. <div id="divUserID" data-role="fieldcontain">
  4. <label for="txtUserID">User ID:</label>
  5. <input type="text" value="" name="txtUserID" id="txtUserID" placeholder="User ID" autocomplete="off" />
  6. </div>
  7. <div id="captcha_container"></div>
  8. <input type="submit" name="btnForgotPassword" id="btnForgotPassword" value="Reset your Password" disabled>
  9. </fieldset>
  10. </form>


Thanks,