onChange Event Handler should not be used with Select Element
onchange event, when used in conjunction with the
select form control, can cause problems for people with disabilities. Browser keyboard support for the combination of
onchange event and the
select form control does not allow the user to view menu options without triggering the onChange event, which moves the user to another web page. As browser developers learn of this problem they improve keyboard support, but it will be some time before legacy browsers are replaced with newer versions, so the problem still exists.
- People with disabilities can use keyboard commands to choose options from
selectelement options in a way that supports the keyboard.
- All users will benefit from being able to use keyboard commands in addition to selection options from a
- Developers benefit by providing users with multiple ways to interact with their web resources.
- The onchange event is often used in conjunction with the select element to move users to other pages.
- select element
- The select element prompts a user to select an item from a list.
- Illinois Information Technology Accessibility Standards
- 13.1 Ensure that scripted functions are usable with assistive technologies.
- 13.2 Ensure that significant interactions can be performed with both keyboard and mouse.
- Section 508
- 1194.21 (a) When software is designed to run on a system that has a keyboard, product functions shall be executable from a keyboard where the function itself or the result of performing a function can be discerned textually.
- 1194.21 (l) When electronic forms are used, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues.
- 1194.22 (l) When pages utilize scripting languages to display content, or to create interface elements, the information provided by the script shall be identified with functional text that can be read by assistive technology.
- 1194.22 (n) When electronic forms are designed to be completed on-line, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues.
- W3C Web Content Accessibility Guidelines 2.0
- 2.1.1 Keyboard
- 2.1.2 No Keyboard Trap
- 2.1.3 Keyboard (No Exception)
- Web Content Accessibility Guidelines (WCAG 1.0)
- 6.4 For scripts and applets, ensure that event handlers are input device-independent. [Priority 2]
- 8.1 Make programmatic elements such as scripts and applets directly accessible or compatible with assistive technologies. [Priority 1 if functionality is important and not presented elsewhere, otherwise Priority 2]
- 9.3 For scripts, specify logical event handlers rather than device-dependent event handlers. [Priority 2]