How does role = form help accessibility?

I read that the role attribute was added to Bootstrap for accessibility, and I would like to know how <form role="form"> provides accessibility. See http://getbootstrap.com/css/#forms-example for an example of this specific use.

I did a bootstrap repo search for the "role" to no avail.

My problem is that the information seems redundant. The concept that an element is a form is already expressed by the HTML ( <form> ) tag itself, so that helps if we also add that the element plays the role from form ? It would be advisable to add role="..." if the role is different from form (I don't know what - but let it pretend); (especially without specific arguments / usage examples), this is puzzling at best.

+60
html accessibility forms twitter-bootstrap-3
Feb 20 '14 at 23:53
source share
4 answers

If you add role="form" to the form, the screen reader will see it as a region on the web page. This means that the user can easily navigate to the form using their quick navigation keys (for example, in JAWS 15 R is used for this). In addition, your user can easily find where the form begins and ends, because screen readers mark the beginning and end of the regions.

+72
Feb 21 '14 at 0:51
source share

Semantically speaking, the default form is, well, a form. However, not all accessibility applications (screen readers, etc.) are developed the same way, and some may use elements (even a form element) with the role=form attribute differently, even if they understand that the element of the parent form will have the same semantic meaning with or without the role=form attribute.

+3
Feb 21 '14 at
source share

I would like to point out that the article @ user664833 mentioned in comment states that role="form" should not include <form> elements , but rather a <div> or some other element that does not semantically indicate that it contains form elements.

The <form> element is probably already being handled appropriately by modern screen readers.

Quote (link):

We recommend using [ role="form" ] for a semantically neutral element, such as a <div> not for a <form> element, since the element already has default role semantics .

+3
Sep 14 '16 at 17:13
source share

In fact, the ARIA Recommendation clearly states that the semantics of the host language should not be changed in section 1.4:

"It is not recommended to create objects with a style and script when the host language provides a semantic element for this type of object. Although WAI-ARIA can improve the accessibility of these objects, accessibility is best provided by allowing the user agent to process the object initially. For example, it is better to use the h1 element in HTML than using the title role in a div element. "

So, the record <form role='form'> not only superfluous, but also a recommendation. Side [d] effects similar to one of the mentioned results do not correspond to the recommendation.

+2
Jan 09 '17 at 16:37 on
source share



All Articles