Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter CSS so that screen readers ignore honeypots #35

Closed
jameshibbard opened this issue Nov 4, 2013 · 3 comments
Closed

Alter CSS so that screen readers ignore honeypots #35

jameshibbard opened this issue Nov 4, 2013 · 3 comments

Comments

@jameshibbard
Copy link
Contributor

Honeypot form fields currently look like this:

<div style="position: absolute; left: -2000px;"><input type="text" name="name"  value="" /></div>

Fields positioned off-screen in this way will still be voiced by screen readers and could possibly cause users who are reliant on these technologies, to enter something into them.

Changing the CSS thus will avoid this problem:

<div style="display:none"><input type="text" name="name"  value="" /></div>

Ref: http://webaim.org/techniques/css/invisiblecontent/

@guilhermesimoes
Copy link

The thing is, display: none is too obvious and spammers can make a quick test for that property. You could use an aria attribute to hide the content from screen readers, like this:

<div style="position: absolute; left: -2000px;" aria-hidden="true">...</div>

But I guess this is also trivial for spammers to check. I'm not sure if there's a good solution for this.

@erik-megarad
Copy link
Owner

AFAIK there's no way to make this function properly for screen readers while also making it botproof. It's a choice you're going to have to make when you decide whether to implement this. I would be open to a PR that makes this a configurable option, however.

@jameshibbard
Copy link
Contributor Author

It only took me a year, but I just sent you a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants