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.
Sufficient Techniques for 4.1.2 – Name, Role, Value
Situation A: If using a standard user interface component in a markup language
(e.g. HTML):
- 1.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:
- H91: Using HTML form controls and links
(HTML) - 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) - H88: Using HTML according to spec
- 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:
- 1.Exposing the names and roles, allowing user-settable properties to be
directly set, and providing notification of changes using one of the following
techniques:
- SCR21: Using functions of the Document Object Model (DOM) to add
content to a page
(Scripting)
Situation C: If using a standard user interface component in a programming technology:
- 1.G135: Using the accessibility API features of a technology to expose
names and roles, to allow user-settable properties to be directly set, and to
provide notification of changes
Situation D: If creating your own user interface component in a programming
language:
- 1.G10: Creating components using a technology that supports the accessibility
API features of the platforms on which the user agents will be run to expose
the names and roles, allow user-settable properties to be directly set, and
provide notification of changes
Advisory Techniques for 4.1.2 – Name, Role, Value
- Providing labels for all form controls that do not have implicit
labels
Failures for SC 4.1.2 – Name, Role, Value
- F59: Failure of Success Criterion 4.1.2 due to using script to
make div or span a user interface control in HTML
Note: This failure may be solved in the future using DHTML roadmap techniques.
- F15: Failure of Success Criterion 4.1.2 due to implementing custom
controls that do not use an accessibility API for the technology, or do so incompletely - F20: Failure of Success Criterion 1.1.1 and 4.1.2 due to not updating
text alternatives when changes to non-text content occur - F68: Failure of Success Criterion 1.3.1 and 4.1.2 due to the association
of label and user interface controls not being programmatically determinable - F79: Failure of Success Criterion 4.1.2 due to the focus state of
a user interface component not being programmatically determinable or no notification
of change of focus state available - F86: Failure of Success Criterion 4.1.2 due to not providing names
for each part of a multi-part form field, such as a US telephone number - F89: Failure of 2.4.4, 2.4.9 and 4.1.2 due to using null alt on
an image where the image is the only content in a link
http://www.w3.org/TR/UNDERSTANDING-WCAG20/ensure-compat-rsv.html