Topic on Extension talk:FlexForm

Recaptcha not working?

4
InnerCitadel (talkcontribs)

I've created a contact form. I put recaptcha-v3-action="contactform" as a value in <_form/>, plus the two keys in local settings, but recaptcha isn't working. It sends the email but without using recaptcha. It doesn't show the icon on the bottom right suggesting it isn't loading at all. Getting about one spam email an hour. Any ideas? This is my form:

<_form action="email" id="contactform" messageonsuccess="Thank you for your message." recaptcha-v3-action="contactform" restrictions="lifted">
<_email template="MediaWiki:FlexForm_mail_template"></_email>
<_label for="name">Name</_label>
<_input type="text" id="name" name="name" required="required" placeholder="Your name.."/>
<_label for="email">Email</_label>
<_input type="text" id="email" name="email" required="required" placeholder="Your email.."/>
<_label for="subject">Subject</_label>
<_input type="text" id="subject" name="subject" placeholder="Your subject.."/>
<_label for="message">Message</_label>
<_input type="textarea" rows="10" id="message" name="message" required="required" placeholder="Your message.."/>
<_input type="submit" value="Submit"/>
</_form>

In the meantime I'm testing the following, which displays the recaptcha logo on the bottom right:

<html>
<script src="https://www.google.com/recaptcha/api.js"></script>
<script>
function onSubmit(token) {
document.getElementById("contactform").submit();
}
</script>
</html>
<div class="container-contact">
<_form action="email" id="contactform" messageonsuccess="Thank you for your message." recaptcha-v3-action="contactform" restrictions="lifted">
<_email template="MediaWiki:FlexForm_mail_template"></_email>
<_label for="name">Name</_label>
<_input type="text" id="name" name="name" required="required" placeholder="Your name.."/>
<_label for="email">Email</_label>
<_input type="text" id="email" name="email" required="required" placeholder="Your email.."/>
<_label for="subject">Subject</_label>
<_input type="text" id="subject" name="subject" placeholder="Your subject.."/>
<_label for="message">Message</_label>
<_input type="textarea" rows="10" id="message" name="message" required="required" placeholder="Your message.."/>
<_input type="submit" value="Submit "class="g-recaptcha" data-sitekey="KEY REDACTED FOR THIS POST" data-callback='onSubmit' data-action='submit'/>
</_form>
</div>
Sen-Sai (talkcontribs)

I have released 1.1.6. Could you give that a try ?

InnerCitadel (talkcontribs)

@Sen-Sai It is working now thank you!!!

Sen-Sai (talkcontribs)

Sorry for the late response, I was on holidays.

I had a quick look and noticed some not converted WSForm code in the reCaptcha part of FlexForm. We were thinking of implementing reCaptcha v2 as we thought v3 was less reliable and I guess it was left alone and unfortunately also untested.

I will release an update the soonest with a working version!

Reply to "Recaptcha not working?"