Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I added this trivial honeypot field to a site’s register-interest form in late 2021, and it has been very effective at culling spam: I had been getting an average of around one spam message a day, but after adding it it took a year and a half for one to get through, and no others have got through.

  <style>.pot{display:none}</style>
  <div class="f pot">
      <label for=username><b>If you are human, leave this field blank:</b> <em>(required)</em></label>
      <input name=username id=username>
  </div>
The whole field is hidden with CSS; the “if human, leave blank” instruction is thus only used for text browsers, but I still prefer to have it.


I wonder if this is filled out automatically by browsers like Chrome when doing auto fill...


I would be extremely surprised if it filled it: `display: none` makes the field not be rendered, and autofill should only fill stuff the user could fill.


As a text browser user I thank you for adding that label.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: