Go Back   SitePoint Forums > Forum Index > Design Your Site > Web Page Design > Accessibility and Usability
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Nov 7, 2009, 10:09   #1
Divisive Cotton
SitePoint Addict
 
Divisive Cotton's Avatar
 
Join Date: Jun 2008
Location: Andy lives in London, UK
Posts: 261
Hidden field in form

I've been adding a field into forms and then hiding it with display: none

If a spam bot comes across the form it automatically fills in the field and which is then rejected after validation

For the purpose of stopping spam bots it seems to be pretty successful

However, how does this level with accessibility? Any advice is welcome.
Divisive Cotton is offline   Reply With Quote
Old Nov 7, 2009, 12:27   #2
stonedeft
SitePoint Zealot
 
stonedeft's Avatar
 
Join Date: Aug 2009
Posts: 166
Wow thats a good idea to fight spam bots.
stonedeft is offline   Reply With Quote
Old Nov 7, 2009, 13:03   #3
felgall
SitePoint Mentor
SitePoint Award Recipient
 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, NSW, Australia
Posts: 9,620
Quote:
Originally Posted by Divisive Cotton View Post
I've been adding a field into forms and then hiding it with display: none

If a spam bot comes across the form it automatically fills in the field and which is then rejected after validation

For the purpose of stopping spam bots it seems to be pretty successful

However, how does this level with accessibility? Any advice is welcome.
display:none will only impact people using browsers that don't process the stylesheet. For those people displaying a label for the field explaining that they should leave the field blank as it is there as a trap for spammers should ensure accessibility for those users.
felgall is online now   Reply With Quote
Old Nov 8, 2009, 22:27   #4
AlexDawson
SitePoint Mentor
 
AlexDawson's Avatar
 
Join Date: Feb 2009
Location: England, UK
Posts: 4,416
It should be fine, screen readers tend to ignore anything using display: none so they would skip over the hidden field (which is of no use to them anyway).
AlexDawson is offline   Reply With Quote
Old Nov 9, 2009, 02:48   #5
Stomme poes
Site Point Member
 
Stomme poes's Avatar
 
Join Date: Aug 2007
Location: Netherlands
Posts: 2,676
Uh, no. JAWS can ignore display: none when it comes to labels and other special circumstances. I hate they did that, but whatever. Labels get read out... I'd have to go back and check Juicy Studio to see if Window Eyes did that too.

*edit only problem with it is the age, but my JAWS10 reads out display: none labels still: http://juicystudio.com/article/scree...splay-none.php

Quote:
For those people, displaying a label for the field explaining that they should leave the field blank as it is there as a trap for spammers should ensure accessibility for those users.
Amen, nothing more frustrating for humans than to be accidentally considered a spammer : )

If I make a post on the Fronteers site, they use Javascript to hide a question. Since i don't have that on, I get an extra field. The label says "NEE invullen" (fill in NO) but I misread it and thought it said "NIET invullen" (don't fill in) so I kept triggering the spam filter, lawlz. This can also work since most bots don't process Javascript.

On a moving site I haz:
Code:
<label for="spamz" id="spamvraag"><span>AUB <strong>Niet invullen</strong>, dit is een anti-spam vraag:</span>
<input type="text" id="spamz" name="spamz" title="aub niet invullen!"></label>
Title is an extra to really catch any screen reader users who have titles on, though it does trigger that old W-E bug where inputs inside labels aren't focussable... then again, for this question, that's just fine : )

One thing I might want to look out for are smarter bots who might be scanning the label for the word "spam" though. I mean, if I made such bots I'd consider adding something like that : )
Stomme poes is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 19:50.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved