See Understanding Techniques for WCAG Success Criteria for important information about the usage of these informative techniques and how they relate to the normative WCAG 2.
The Applicability section explains the scope of the technique, and the presence of techniques for a specific technology does not imply that the technology can be used in all situations to create content that meets WCAG 2. HTML and XHTML with support for scripting. See User Agent Support Notes for SCR The objective of this technique is to demonstrate how to correctly use an onchange event with a select element to update other elements on the Web page.
This technique will not cause a change of context. When there are one or more select elements on the Web page, an onchange event on one, can update the options in another select element on the Web page. All of the data required by the select elements is included within the Web page.
The first select element contains a list of continents. The second select element will contain a partial list of countries located in the selected continent.
There is an onchange event associated with the continent select.
Here is a working example: Accessible Forms using WCAG 2. Navigate to the trigger select element in this example, the one to select continents and change the value of the select. Navigate to the select element that is updated by the trigger in this example, the one to select countries. Check that the matching option values are displayed in the other select element. Navigate to the trigger select element, navigate through the options but do not change the value.
Check that the matching option values are still displayed in the associated element. It is recommended that the select elements are tested with an assistive technology to verify that the changes to the associated element are recognized.
HTML onchange Event Attribute
If this is a sufficient technique for a success criterion, failing this test procedure does not necessarily mean that the success criterion has not been satisfied in some other way, only that this technique has not been successfully implemented and can not be used to claim conformance. This Web page is part of Techniques and Failures for Web Content Accessibility Guidelines 2.
The entire document is also available as a single HTML file.
See the The WCAG 2. To send public comments, please follow the Instructions for Commenting on WCAG 2. W3C liability , trademark and document use rules apply. Techniques for WCAG 2. Important Information about Techniques Applicability Description Examples Resources Related Techniques Tests.
Important Information about Techniques See Understanding Techniques for WCAG Success Criteria for important information about the usage of these informative techniques and how they relate to the normative WCAG 2. Applicability HTML and XHTML with support for scripting. User Agent and Assistive Technology Support Notes See User Agent Support Notes for SCR Overview of the code below countryLists array variable which contains the list of countries for each continent in the trigger select element.
Resources are for information purposes only, no endorsement implied. Procedure Navigate to the trigger select element in this example, the one to select continents and change the value of the select. Expected Results Step 3 and 5 are true.