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.
Benefits to People with Disabilities
- People with disabilities can use keyboard commands to choose options from select element options in a way that supports the keyboard.
Benefits to Everyone
- All users will benefit from being able to use keyboard commands in addition to selection options from a select form control.
Benefits to Developers
- Developers benefit by providing users with multiple ways to interact with their web resources.
onchangeevent handler must not be used on
selectelements since the firing of the event commonly occurs when focus changes while viewing the options, this often results in people be redirected to other pages without their control.
Related Accessibility Requirements
- § 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.