msurguy / Honeypot

Simple spam prevention package for Laravel applications
maxoffsky.com/code-blog/implementing-honeypot-spam-prevention-in-laravel-applications/
MIT License
429 stars 44 forks source link

Duplicate Id when using the same Honeypot #50

Closed bencarrr closed 5 years ago

bencarrr commented 7 years ago

I have two of exactly the same forms on a page, which both include the same Honeypot::generate() method. When doing an HTML validity check (https://validator.w3.org) It says there are duplicate ids on the containing div ..._wrap.

  1. Is this wrapper necessary?
  2. Is there a way around using the same id on this element
mariopro commented 5 years ago

I've noticed the same issue in a multiple forms modal where I had three forms. The solution that I tested and works is to change the id="" to class="" on the div and the inputs. This way the honeypot works as supposed and the HTML validation passes.

msurguy commented 5 years ago

@Benjyclay @mariopro this is fixed in the newest version of the package. Thanks for your reports!