org.sonar.l10n.web.rules.Web.FieldsetWithoutLegendCheck.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-web-plugin Show documentation
Show all versions of sonar-web-plugin Show documentation
Enables scanning of HTML, and JSP/JSF files.
For users of assistive technology such as screen readers, it may be challenging to know what is expected in each form's input. The input's label
alone might not be sufficient: 'street' could be part of a billing or a shipping address for instance.
Fieldset legends are read out loud by screen readers before the label each time the focus is set on an input. For example, a legend 'Billing
address' with a label 'Street' will read 'Billing address street'. Legends should be short, and 'Your' should not be repeated in both the legend and
the label, as it would result in 'Your address Your City' being read.
Noncompliant Code Example
<fieldset> <!-- Noncompliant -->
Street: <input type="text"><br />
Town: <input type="text"><br />
Country: <input type="text"><br />
</fieldset>
Compliant Solution
<fieldset>
<legend>Billing address</legend>
Street: <input type="text"><br />
Town: <input type="text"><br />
Country: <input type="text"><br />
</fieldset>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy