Name, Role, Value:
Understanding SC 4.1.2
4.1.2 Name, Role, Value: For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies. (Level A)
Note: This success criterion is primarily for Web authors who develop or script their own user interface components. For example, standard HTML controls already meet this success criterion when used according to specification.
Intent of this Success Criterion
The intent of this Success Criterion is to ensure that Assistive Technologies (AT) can gather information about, activate(or set) and keep up to date on the status of user interface controls in the content.
When standard controls from accessible technologies are used, this process is straightforward. If the user interface elements are used according to specification the conditions of this provision will be met. (See examples of Success Criterion 4.1.2 below)
If custom controls are created, however, or interface elements are programmed (in code or script) to have a different role and/or function than usual, then additional measures need to be taken to ensure that the controls provide important information to assistive technologies and allow themselves to be controlled by assistive technologies.
A particularly important state of a user interface control is whether or not it has focus. The focus state of a control can be programmatically determined, and notifications about change of focus are sent to user agents and assistive technology. Other examples of user interface control state are whether or not a checkbox or radio button has been selected, or whether or not a collapsible tree or list node is expanded or collapsed.
Note: Success Criterion 4.1.2 requires a programmatically determinable name for all user interface components. Names may be visible or invisible. Occasionally, the name must be visible, in which case it is identified as a label. Refer to the definition of name and label in the glossary for more information.
Specific Benefits of Success Criterion 4.1.2:
Providing role, state, and value information on all user interface components enables compatibility with assistive technology, such as screen readers, screen magnifiers, and speech recognition software, used by people with disabilities.
Examples of Success Criterion 4.1.2
Accessible APIs
A Java applet uses the accessibility API defined by the language. Refer to the IBM Guidelines for Writing Accessible Applications Using 100% Pure Java.
Related Resources
Resources are for information purposes only, no endorsement implied.
Techniques and Failures for Success Criterion 4.1.2 - Name, Role, Value
Each numbered item in this section represents a technique or combination of techniques that the WCAG Working Group deems sufficient for meeting this Success Criterion. The techniques listed only satisfy the Success Criterion if all of the WCAG 2.0 conformance requirements have been met.
Sufficient Techniques
Instructions: Select the situation below that matches your content. Each situation includes techniques or combinations of techniques that are known and documented to be sufficient for that situation.
Situation A: If using a standard user interface component in a markup language (e.g. HTML):
G108: Using markup features to expose the name and role, allow user-settable properties to be directly set, and provide notification of changes using technology-specific techniques below:
H44: Using label elements to associate text labels with form controls (HTML)
H64: Using the title attribute of the frame and iframe elements (HTML)
H65: Using the title attribute to identify form controls when the label element cannot be used (HTML)
SCR21: Using functions of the Document Object Model (DOM) to add content to a page (Scripting)
Situation B: If using script or code to re-purpose a standard user interface component in a markup language:
Exposing the names and roles, allowing user-settable properties to be directly set, and providing notification of changes using one of the following techniques:
Additional Techniques (Advisory) for 4.1.2
Although not required for conformance, the following additional techniques should be considered in order to make content more accessible. Not all techniques can be used or would be effective in all situations.
Providing labels for all form controls that do not have implicit labels (future link)
Common Failures for SC 4.1.2
The following are common mistakes that are considered failures of Success Criterion 4.1.2 by the WCAG Working Group.
Note: This failure may be solved in the future using DHTML roadmap techniques.
Key Terms
- assistive technology (as used in this document)
hardware and/or software that acts as a user agent, or along with a mainstream user agent, to provide functionality to meet the requirements of users with disabilities that go beyond those offered by mainstream user agents
Note 1: functionality provided by assistive technology includes alternative presentations (e.g., as synthesized speech or magnified content), alternative input methods (e.g., voice), additional navigation or orientation mechanisms, and content transformations (e.g., to make tables more accessible).
Note 2: Assistive technologies often communicate data and messages with mainstream user agents by using and monitoring APIs.
Note 3: The distinction between mainstream user agents and assistive technologies is not absolute. Many mainstream user agents provide some features to assist individuals with disabilities. The basic difference is that mainstream user agents target broad and diverse audiences that usually include people with and without disabilities. Assistive technologies target narrowly defined populations of users with specific disabilities. The assistance provided by an assistive technology is more specific and appropriate to the needs of its target users. The mainstream user agent may provide important functionality to assistive technologies like retrieving Web content from program objects or parsing markup into identifiable bundles.
Example: Assistive technologies that are important in the context of this document include the following:
screen magnifiers, and other visual reading assistants, which are used by people with visual, perceptual and physical print disabilities to change text font, size, spacing, color, synchronization with speech, etc. in order to improve the visual readability of rendered text and images;
screen readers, which are used by people who are blind to read textual information through synthesized speech or braille;
text-to-speech software, which is used by some people with cognitive, language, and learning disabilities to convert text into synthetic speech;
speech recognition software, which may be used by people who have some physical disabilities;
alternative keyboards, which are used by people with certain physical disabilities to simulate the keyboard (including alternate keyboards that use head pointers, single switches, sip/puff and other special input devices.);
alternative pointing devices, which are used by people with certain physical disabilities to simulate mouse pointing and button activations.
- name
text by which software can identify a component within Web content to the user
Note 1: The name may be hidden and only exposed by assistive technology, whereas a label is presented to all users. In many (but not all) cases, the label and the name are the same.
Note 2: This is unrelated to the name attribute in HTML.
- programmatically determined (programmatically determinable)
determined by software from author-supplied data provided in a way that different user agents, including assistive technologies, can extract and present this information to users in different modalities
Example 1: Determined in a markup language from elements and attributes that are accessed directly by commonly available assistive technology.
Example 2: Determined from technology-specific data structures in a non-markup language and exposed to assistive technology via an accessibility API that is supported by commonly available assistive technology.
- programmatically set
set by software using methods that are supported by user agents, including assistive technologies
- role
text or number by which software can identify the function of a component within Web content
Example: A number that indicates whether an image functions as a hyperlink, command button, or check box.
- user agent
any software that retrieves and presents Web content for users
Example: Web browsers, media players, plug-ins, and other programs — including assistive technologies — that help in retrieving, rendering, and interacting with Web content.
- user interface component
a part of the content that is perceived by users as a single control for a distinct function
Note 1: Multiple user interface components may be implemented as a single programmatic element. Components here is not tied to programming techniques, but rather to what the user perceives as separate controls.
Note 2: User interface components include form elements and links as well as components generated by scripts.
Example: An applet has a "control" that can be used to move through content by line or page or random access. Since each of these would need to have a name and be setable independently, they would each be a "user interface component."