From 1cbc30eb588528b7078ad2845e08251ae6aed50f Mon Sep 17 00:00:00 2001 From: Ryan Matthew Pierson Date: Wed, 8 Feb 2017 11:37:28 -0600 Subject: [PATCH] Documented honeypot field https://github.com/getgrav/grav-learn/issues/356 --- .../01.blueprints/01.fields-available/docs.md | 18 ++++++++++++++++ .../02.forms/01.fields-available/docs.md | 21 ++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/pages/06.forms/01.blueprints/01.fields-available/docs.md b/pages/06.forms/01.blueprints/01.fields-available/docs.md index e6186a61e..e556fc3c0 100644 --- a/pages/06.forms/01.blueprints/01.fields-available/docs.md +++ b/pages/06.forms/01.blueprints/01.fields-available/docs.md @@ -549,6 +549,24 @@ header.a_file: --- +### The Honeypot Field + +The `honeypot` field type creates a hidden field that, when filled out, will return with an error. This is a useful way to prevent bots from filling out and submitting a form. + +Example: + +```yaml +fields: + - name: honeypot + type: honeypot +``` + +This is a simple text field which does not appear on the front end. Bots, which detect fields in the code and fill them out automatically, will likely fill the field out. The error prevents that form from being properly submitted. The error comes back next to the form element, rather than on the top in a message block. + +A honeypot field is a popular alternative to captcha fields. + +--- + ### The Ignore Field The `ignore` field type can be used to remove unused fields when extending from another blueprint diff --git a/pages/06.forms/02.forms/01.fields-available/docs.md b/pages/06.forms/02.forms/01.fields-available/docs.md index d5f71eaad..6347b1629 100644 --- a/pages/06.forms/02.forms/01.fields-available/docs.md +++ b/pages/06.forms/02.forms/01.fields-available/docs.md @@ -12,12 +12,13 @@ The Forms plugin provides the following fields, which you can use to build your | :----- | :----- | | **[Captcha](#the-captcha-field)** | A captcha antispam field, using reCAPTCHA | | **[Checkbox](#the-checkbox-field)** | A simple checkbox | -| **[Checkboxes](#the-checkboxes-field)** | A series of checkboxes | +| **[Checkboxes](#the-checkboxes-field)** | A series of checkboxes | | **[Date](#the-date-field)** | A date selection field | | **[Display](#the-display-field)** | A text or instructions field (not an input field) | | **[Email](#the-email-field)** | An email field, with validation | | **[File](#the-file-field)** | A file field for uploading | | **[Hidden](#the-hidden-field)** | An hidden field | +| **[Honeypot](#the-honeypot-field)** | A hidden field which returns an error when filled | | **[Password](#the-password-field)** | A password field | | **[Radio](#the-radio-field)** | A radio input type | | **[Range](#the-range-field)** | A range input type | @@ -370,6 +371,24 @@ header.some_field: --- +### The Honeypot Field + +The `honeypot` field type creates a hidden field that, when filled out, will return with an error. This is a useful way to prevent bots from filling out and submitting a form. + +Example: + +```yaml +fields: + - name: honeypot + type: honeypot +``` + +This is a simple text field which does not appear on the front end. Bots, which detect fields in the code and fill them out automatically, will likely fill the field out. The error prevents that form from being properly submitted. The error comes back next to the form element, rather than on the top in a message block. + +A honeypot field is a popular alternative to captcha fields. + +--- + ### The Password Field The `password` field type is used to present a password text input field.