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>