Rajout du module ReCaptcha

This commit is contained in:
2021-02-09 15:09:14 +01:00
parent de56924f04
commit aa4a44aea7
22 changed files with 713 additions and 15 deletions

View File

@@ -0,0 +1,22 @@
<script src="https://www.google.com/recaptcha/api.js?hl={lang attr="code"}" async defer></script>
<script>
window.onload = function() {
var captchaDiv = document.getElementById("recaptcha-invisible");
if (captchaDiv !== null) {
var form = captchaDiv.parentElement;
form.addEventListener("submit", function(event) {
if (!grecaptcha.getResponse()) {
event.preventDefault(); //prevent form submit
grecaptcha.execute();
}
});
onCompleted = function() {
if (form.reportValidity() !== false) {
form.submit();
}
}
}
}
</script>