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 common 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.
Using 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With