onSubmit(token) - Recaptcha invisible v2

19 Views Asked by At

How can i translate this function onSubmit(token) { document.getElementById("recaptcha").submit(); }

Into my AJAX code. I don't want to use the function onSubmit(token), i want to use the token inside the below code.

 $(document).ready(function(){ $("#loginFormHeader").on("submit", function(e){
     e.preventDefault();
     var email = $('#loginEmailHeader').val();
     var loginSubmit = $('#loginSubmitButtonHeader').val();
     var password = $('#loginPasswordHeader').val();
     $.ajax({
       url: "login-ajax.php",
       type: "POST",
       data: { user_email:email,login:loginSubmit,user_password:password},
       dataType: 'json',
       success: function (data) {

         if(data.type == 'success') {

}
});
});

I don't know how to do this. How do i get the token and use it for recaptcha v2 invisible

0

There are 0 best solutions below