Honeypot not working

Hello

I’m runnig a next-Application with netlify Forms.
Domain of Proof of Concept:
https://poc-netlify-forms.netlify.app/

The Honeypot field is present and also recognized, I’m getting the"Extra spam prevention enabled via honeypot field." Message in the Form-Submission Overview.

But if I’m testing the Bot-Field and put in some value in the field the Form shouldn’t be submitted, right? Or at least shouldn’t appear in the Form submissions. Unfortunately it does, even in the “Verfied” Section…

Steps to reproduce:

  1. Browse URL
  2. Toggle Form
  3. Mage Botfield visible by removing class hidden in the dev tools
  4. Enter value in botfield
  5. Submit Form
  6. Check Form Submissions => Submission appears

I really want to use the honeypot protection as we are no fan of the recaptchas. So I’d appreciate some feedback or solution on this :slight_smile:

Thank you in advance!

Hey @vonbyte

Looking at the page, the placeholder (or hidden) form does not contain the netlify-botfield attribute, on the rendered form. Also, the rendered form contains inputs (e.g. email) that the hidden placeholder form does not. As stated in the Work with JavaScript-rendered forms documentation

…and input fields with name attributes to match the inputs of your JavaScript-rendered form.

This has nothing to do with it:
On Build process the fields are detected correctly:

12:14:00 PM: Detected form fields:

12:14:00 PM: - fullName

12:14:00 PM: - email

12:14:00 PM: - message

The form submissions also include the email-Addresses correctly.

As stated in the docks, the netlify-honeypot is stripped out by the bots, automatically, when detected.
So it’s in my opinion the correct handling (because the honeypot field IS in the form initially).

Got it!

It was a stateful component. And as always the problem sat in front of the monitor:
The moment i added my onchange function to add the bot-field to the payload for the ajax-submission everything worked fine.

Hope it helps other people who forgot to add the custom logic.

1 Like

Hey there, @vonbyte :wave:

Thanks so much for coming back and sharing your solution! Happy building :rocket: