Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
jquery submit (repacaptcha) function works only on second click

I have added recaptcha v3 on my website and works fine, but the problem is that I need two times click to submit my form. On first click its generates token and on the second its load the website. Could I just make that my one click on the button would count as two?

 <script>
     $(document).ready(function() {
    $("#wyz_registration_form").submit(function(event) {
    
        event.preventDefault();
        var email = $('#wyz_user_email').val();
        var user = $('#wyz_user_register').val();
    
  
        grecaptcha.ready(function() {
            grecaptcha.execute('MYKEY', {action: 'testine_forma'}).then(function(token) {
                //console.log(token);
                $('#wyz_registration_form').prepend('<input type="hidden" name="token" value="' + token + '">');
                $('#wyz_registration_form').prepend('<input type="hidden" name="action" value="testine_forma">');
                $('#wyz_registration_form').unbind('submit').submit();
            });;
        });
  });
 // $("button").click(function(){  //make my button click two times
    //   $(this).dblclick(); 
   //$("#wyz_registration_form").submit();
  
  // console.log('testas');
 // });


about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!