Skip to content

Commit

Permalink
FEATURE: Initial import. Honey pot field
Browse files Browse the repository at this point in the history
  • Loading branch information
camspiers committed Sep 10, 2012
0 parents commit 797c14e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions _config.php
@@ -0,0 +1 @@
<?php
20 changes: 20 additions & 0 deletions code/HoneyPotField.php
@@ -0,0 +1,20 @@
<?php

class HoneyPotField extends FormField
{

public function validate($validator)
{
if (!is_null($this->value)) {
$validator->validationError(
$this->name,
"This field should not be completed",
"validation",
false
);

}
return true;
}

}
5 changes: 5 additions & 0 deletions composer.json
@@ -0,0 +1,5 @@
{
"name": "camspiers/honeypot",
"type": "silverstripe-module",
"minimum-stability": "dev"
}

0 comments on commit 797c14e

Please sign in to comment.