Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent IE form auto-fill from filling in a honeypot field?

I have implemented honeypot fields on the majority of my client's contact forms in order to prevent spamming. However, I'm noticing that IE's form auto-fill option fills in the honeypot field, and thus triggers my anti-spam logic. How can I prevent this?

I've tried giving the form field a different name - it is currently called emailConfirmation, but I've tried conf_em and liame, and it's still auto-filling. I've also tried moving the honeypot field to the very bottom of the form - nowhere near the existing email input.

like image 461
Eric Belair Avatar asked Feb 29 '12 14:02

Eric Belair


People also ask

How does a honeypot form work?

Honeypot form protection means that an invisible field is added to a form. If this invisible field is filled out (bots will usually put in a value), then the form will return an error. Normal users (read: human beings) won't ever see the field, so they won't fill it out.

What is honeypot field?

A honeypot is a field added to the form that the users can't see due to CSS or JavaScript (which hides the field).


1 Answers

As suggested in the answer David Faber linked to, try adding the autocomplete="off" attribute to the input tag.

This is not a standard HTML4 / XHTML attribute, but all major browsers understand it. And it is standardized in HTML5.

like image 95
Ilmari Karonen Avatar answered Sep 25 '22 12:09

Ilmari Karonen