Domanda

I have an asp.net web page and I'm looking at different ways to make a form accessible.

On Example #1 I have a label that is associated to the drop-down, on Example #2 I have an Aria-Label tag with a description of the drop-down.

The original design had no labels for the drop-downs, so adding them kind of ruins the look and flow of the form. The drop-downs are used for filtering and are inline across the top of the page. Under the drop-downs are two buttons, one for filtering off of whats in the drop-downs and one to reset the form so it shows all results with no filtering.

My question is ... Is adding an Aria-Label tag acceptable, or is an associated label really required?

Example #1

asp:Label id="lbProgramName" runat="server" Text="Program Name:" AssociatedControlID="ddlProgramName

asp:DropDownList id="ddlProgramName" runat="server" CssClass="span5"

Example #2

asp:DropDownList ID="ddlProgramName" runat="server" CssClass="span5" aria-label="Program Names"
È stato utile?

Soluzione

If you have a visual label (like your asp:Label with the AssociatedControlId attribute), you don't need the aria-label. The aria-label is used only when there is no association between a descriptive text and the control.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top