Skip to content

Commit

Permalink
Fix setting of response token at multiple forms
Browse files Browse the repository at this point in the history
  • Loading branch information
jansramek authored and f3l1x committed Oct 24, 2019
1 parent 6c75ebe commit 2aea1c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion assets/invisibleRecaptcha.js
Expand Up @@ -9,7 +9,12 @@
for (var i = 0; i < length; i++) {
grecaptcha.render(items[i]);
};
grecaptcha.execute();
grecaptcha.execute().then(function (token) {
var inputs = document.getElementsByClassName('g-recaptcha-response');
for (var i = 0; i < items.length; i++) {
inputs[i].value = token;
};
});
});
init = true;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/invisibleRecaptcha.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2aea1c8

Please sign in to comment.