html - reCapctcha - form has been validated -
i implementing recaptcha, box checkbox user click , confirm he's not robot being presented, doubt if working, because i'm using if (grecaptcha.getresponse () = = "")
, not know if robot circumvent this, because i'm not analyzing response google api returns, i'm checking if there return.
note: page html, implement recaptcha in jsp.
the following code:
function logar(){ if (grecaptcha.getresponse() == "") { alert("você não clicou no recaptcha, por favor, faça!") return false; } else { document.login.submit(); } }
<script src='https://www.google.com/recaptcha/api.js?hl=pt' async defer></script> <form class="form-inline" role="form" name="login" action="logincontroller.do" method="post"> <div class="modal-body"> usuario: <input type="text" name="login"> senha <input type="text" name="senha"> <div class="g-recaptcha" data-sitekey="xx_chave_xx"></div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">fechar</button> <button type="button" class="btn btn-primary" onclick="logar()" >login</button> </div> </form>
Comments
Post a Comment