We have a request to use a select
element's onchange
to trigger a move to a new page.
In the past, web accessibility literature I've read has generally advised against doing this. This was on the grounds that it breaks user expectation, and browsers (particularly IE < 6) fired the change event even when moving through options with the keyboard, making it impossible for keyboard-only users to make a selection.
IE6+ and all other more modern browsers I have tested fire the select
onchange
when an option is actually selected by mouse or enter key. Analytics for the application in question show that earlier IE browsers are essentially eradicated (< 0.01%)
Given that our users will be able to operate these select
elements properly with a keyboard only, should this feature still be considered an impediment to accessibility? This behavior seems so mon nowadays that I wonder also if it really still does break user expectation in a meaningful way?
EDIT: IE behaves differently if the select
is focused with the mouse or keyboard. When focused with the mouse, keyboarding through options does not fire onchange
but when tabbing to focus it via keyboard, the onchange
does fire when arrowing through.
We have a request to use a select
element's onchange
to trigger a move to a new page.
In the past, web accessibility literature I've read has generally advised against doing this. This was on the grounds that it breaks user expectation, and browsers (particularly IE < 6) fired the change event even when moving through options with the keyboard, making it impossible for keyboard-only users to make a selection.
IE6+ and all other more modern browsers I have tested fire the select
onchange
when an option is actually selected by mouse or enter key. Analytics for the application in question show that earlier IE browsers are essentially eradicated (< 0.01%)
Given that our users will be able to operate these select
elements properly with a keyboard only, should this feature still be considered an impediment to accessibility? This behavior seems so mon nowadays that I wonder also if it really still does break user expectation in a meaningful way?
EDIT: IE behaves differently if the select
is focused with the mouse or keyboard. When focused with the mouse, keyboarding through options does not fire onchange
but when tabbing to focus it via keyboard, the onchange
does fire when arrowing through.
- 5 Wait a second, did you just imply that IE6 is a modern browser? ;) – Andrew Marshall Commented Feb 23, 2011 at 18:33
- What exactly are your question about? – devasia2112 Commented Feb 23, 2011 at 18:36
- @Andrew Marshall After typing that sentence I hoped no one would think that. – Michael Berkowski Commented Feb 23, 2011 at 18:37
-
@Fernando Should the practice of using a
select
to trigger a move to a new page still be avoided because of accessibility concerns? Is that clearer? – Michael Berkowski Commented Feb 23, 2011 at 18:39 - Now it is. I think sometimes it is very useful, depends exactly what your needs since it is provided with the most browsers in the market. I use myself it since I had started to programming ... why "be avoided"? give us one good reason to... – devasia2112 Commented Feb 23, 2011 at 18:46
2 Answers
Reset to default 7Using the onchange
event of the select
element to navigate between pages can definitely pose an accessibility problem for keyboard-only users.
There is at least one method of creating accessible select
elements with onchange
handlers and it has been on the interwebs since 2004!
Direct link to the Accessible Select code.
I agree with you that this type of functionality is very mon. However, most sites use links instead of a <select>
to achieve the effect (if I'm not mistaken). I.E. it's the standard (pun intended).