UndefinedOffset / silverstripe-nocaptcha

A spam protector and form field using Google's reCAPTCHA v2 or optionally a foundation v3 implementation
BSD 3-Clause "New" or "Revised" License
31 stars 37 forks source link

Working with Custom Forms #56

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi!

I'm working with your module for different types of forms on a site. It was easy enough to get Nocaptcha to work with User Forms and Comments, however I'm having big difficulties incorporating it with Custom Forms we're building. Do you know how to resolve this? It might be as easy as building out more on the backend, but I'm stumped myself.

Thanks.

UndefinedOffset commented 4 years ago

For custom forms you should be able to just call $form->enableSpamProtection() to add the spam protection via nocaptcha to your form. See the silverstripe/silverstripe-spamprotection documentation for more on how to do that.

Let me know how you make out :)

ghost commented 4 years ago

Nope, simply putting $form->enableSpamProtection neither shows the box nor lets me submit legit forms. I know it is adding itself to the form by that command, but from what I can tell, it's not doing anything/not accepting the submissions.

ghost commented 4 years ago

Got it, I wasn't including it in the page!