Captchas

Captchas enable you to add additional methods to protect your form from Spam.

Captcha Class

See examples of how to build your Captcha Class from the default Captchas in Sprout Forms:

Register Event

Once you have created your Custom Captcha, register you Captcha class with Sprout Forms to display your Captcha in the Spam Protection settings and enable it for your forms.

namespace mycompany\mycaptchaplugin;  use mycompany\myplugin\integrations\sproutforms\captchas\MyCaptcha; use barrelstrength\sproutforms\services\Forms; use yii\base\Event;  class MyCaptchaPlugin extends Plugin {    public function init()   {     parent::init();          Event::on(Forms::class, Forms::EVENT_REGISTER_CAPTCHAS, function(Event $event) {         $event->types[] = MyCaptcha::class;     });      } } 

TIP

Captcha integrations are available in Sprout Forms for Craft 3. Custom Captchas can also be added to Craft 2 a combination of Events & Hooks.