in my recaptcha google why submit don't work?

634 views Asked by At

I have used this code from google recaptcha, but the submit didn't work (after google captcha nothing happen), the form is not submitted, maybe because i have added my own action for the salesforce ?

    <html>
    <head>
    <script>
  var onSubmit = function(token) {
      console.log('success!');
    };

        var onloadCallback = function() {
          grecaptcha.render('submit', {
            'sitekey' : 'your_site_key',
            'callback' : onSubmit
          });
        };
    </script>
  </head>
  <body>
    <form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" thod="POST">
      <input id='submit' type="submit" value="Submit">
    </form>
    <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"
        async defer>
    </script>

      </body>
</html>

i have also used google recaptcha v3,

my form is submitted but in server side i receive an empty array.

1

There are 1 answers

0
Mohamed Masmoudi On BEST ANSWER

To resolve my issue, i have upgrade it to the reCaptcha v3, it was a lot easier to integrate to my html code. Thanks everyone!