Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong form submitted when multiple captcha used on same page #55

Open
gurucomkz opened this issue Dec 9, 2019 · 0 comments
Open

Wrong form submitted when multiple captcha used on same page #55

gurucomkz opened this issue Dec 9, 2019 · 0 comments

Comments

@gurucomkz
Copy link

gurucomkz commented Dec 9, 2019

When 2 forms on a page both with invisible captcha, I see that only one of them is submitted regardless of which form I actually fill in. I.e. I fill in form 1 but form 2 is being submitted to the server. Found that var form is not retained for window['Nocaptcha-'+_noCaptchaFields[i]].

For a workaround, had to use another wrapper function to ensure the form var keeps its value.

window['Nocaptcha-'+_noCaptchaFields[i]]=(function(form){
    return function(token) {
        return new Promise(function(resolve, reject) {
            if(typeof jQuery!='undefined' && typeof jQuery.fn.validate!='undefined' && superHandler) {
                superHandler(form);
            }else {
                form.submit();
            }
            
            resolve();
        });
    }
})(form);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants