Nette Honeypot Extension

Adds support for honeypot input in Nette Forms.

What it does

Article about honeypot input

TLDR; It creates form input, then hides it using CSS or JS. Spam bots usually fill all fields (especially those with yummy names, like 'email' or 'web'). Human will not fill hidden field, so this is a way to detect bot, instead of forcing user to solve captcha.


Best way to install this is using composer:

composer require wodcz/nette-honeypot

Then register extension:

    honeypot: wodCZ\NetteHoneypot\HoneypotExtension


$form->addHoneypot($name, $caption, $errorMessage, $mode);

$name should be something yummy for robot, like email.

In $caption you should write something for user, which for some reason has not this field hidden.

In $message you may change default error message.

And $mode should be one of wodCZ\NetteHoneypot\Honeypot::MODE_CSS or MODE_JS.

You can also specify your own error callback:

$honeypot = $form->addHoneypot('email');
$honeypot->onError[] = function($control){ .... };


	inline: true/false # if true, extension will append css/js (according to mode) right after input. Otherwise you have to link css/js on your own.
  • 3.0.0 3.0.0

    This release adds support for Nette 3 config syntax (see #4).

    Since this might be a BC-breaking change, I'm releasing this as a new major version.

    Thanks @mateszemek 🎉

  • 2.1.0 2.1.0


    • Prevent browsers from autofill the honeypot input (#3, thanks @zingon)
  • 2.0.0 Nette 3, strict types & type annotations

    Bumps Nette version to 3.0 and requires PHP 7.1.

    As the requirements make the package incompatible with previously supported Nette and PHP, I'm bumping the major version to 2, even though there is no change in the extension functionality.

    See this PR for what's changed.

    Thanks @namo-R ❤️

  • 1.0.1

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette