onChange Event Handler should not be used with Select Element
Overview
The onchange event when used in conjuntion with the select form control can cause problems for people disability. Browser keyboard support for the combinqion of onchange event and the select form control did not allow the user to view menu options without triggering the onChange event, which move the user to another web page. As browser developers learned of this problem they improved the keyboard support, but it will be some time before legacy browsers are replaced with newer versions, so the problem still exists.
Benefit to People with Disabilities
- People with disabilities can use keyboard commands to choose options from
selectelement options in a way that supports the keyboard.
Benefits to All Users
- All users will benefit from being able to use keyboard commands in addition to selection options from a
selectform control.
Benefits to Developers
- Developers benefit by providing users with multiple ways to interact with there web resources.
HTML Markup Details
onchangeattribute- The
onchangeevent is often used in conjunction with theselectelement to move people to other web pages. selectelement- The
selectelement provides a user to select from a list of items.
Related Accessibility Requirements
- 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]
