0

Hi guys I need a problem , there is a button called submit and I want to when I click the button , reCAPTCHA form will appear but now, I have to click three time for display reCAPTCHA form.this is my problem. thank u from now. All HTML Codes :

<html>
    <head>
        <title>reCAPTCHA demo: Simple page</title>
        <script src="https://www.google.com/recaptcha/api.js" async defer></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <script type="text/javascript">

            function onSubmit(token) {
                alert(token)
            }
        function onExpired() {
            alert("onExpired")
        }
        function onError() {
            alert("onError")
        }
        </script>
    </head>
    <body>
        <form id='demo-form' action="?" method="POST">
            <button id ="btnSubmit" class="g-recaptcha" data-sitekey="mysitekey here" data-callback='onSubmit' data-expired-callback='onExpired' error-callback='onError'  >Submit</button>
            <br/>
        </form>

    </body>
</html>
Akif Demirezen
  • 191
  • 1
  • 1
  • 13

0 Answers0