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

Issue adding spam protection field #61

Closed TimStannard closed 4 years ago

TimStannard commented 4 years ago

Hey there! In the installation instructions it says "Finally, add the "spam protection" field to your form fields."

Which name do we call the field? See my Contactpage.php code below (not working)

    $fields = new FieldList( 
        new TextField('Name'), 
        new EmailField('Email'), 
        new TextareaField('Message')
       new SpamProtectionField('Captcha')
    ); 
UndefinedOffset commented 4 years ago

To do this simply call ->enableSpamProtection() on the form object as the readme mentions later on. That should do what you need at least in the most common implementations.