Too much accessibility - FIELDSET LEGENDS

If ever there were a good candidate for a “too much accessibility” award, the FIELDSET LEGEND element would surely take some beating.

Yes yes, I know, if you don’t have a LEGEND on your FIELDSET, some automated accessibility checkers will throw it up as an error. Well, my answer to that is, they don’t have to listen to them!

By this, I don’t mean that LEGEND should never be used, but like everything else in the accessibility toolbox, it’s not what you use, but how you use it.

The right way is to choose LEGEND text that is:

  • Concise: between 1 and 6 words.
  • Relevant: to every single form field in the FIELDSET.
  • Seamless: in that the words chosen for the LEGEND should make sense when joined to each label phrase. This might take a bit more explanation, so read on and you’ll see why.

LEGENDS that fail any of the above are likely to cause confusion, headaches or even a fit of the screaming abdabs, in screen reader users.

The reason is, and read this twice, it’s important: LEGEND text isn’t read at the start of the FIELDSET, it is read at the start of the label. It repeats at the beginning of every single text label in that FIELDSET.

Let’s just examine those important rules again, and see what can happen if they’re ignored:

  • If not concise: it can take an inordinate length of time to get to the question in the label, and there’s no way to skip straight to it.

    Believe it or not, I’ve seen LEGEND text that was 48 words long. This repeated at the start of all 30 questions in that particular FIELDSET. This made the form impossible to complete, because attention switches off after a certain amount of repetition, and then the label itself gets overlooked.

  • If not relevant: conflicting or confusing information can be conveyed when the LEGEND isn’t appropriate to every label.

    For instance, on an e-card sender page, the first FIELDSET grouped the sender and the recipient names and e-mail addresses, using the LEGEND “Your personal details”. This worked fine until it came to the label for the recipient’s name; the label was “Send to:”.

    “Your personal details, send to:” sounds as though some privacy is about to be put at risk. :)

  • If not seamless: the combined sense of the LEGEND and label might be difficult to unravel, or worse, might sound to screen reader users as though the web author was drunk.

    A couple of examples, the first being a numbered list of checkbox options::
    LEGEND: “What did you come to this site for”
    1 to buy clothes
    2 to buy accessories
    3 for store addresses
    4 for other information

    Question 4 comes out particularly garbled as:
    “What did you come to this site for four for other information”.

    A more common nasty is where the word, “Your” is used; in both the LEGEND and the text label, e.g. “Your details: Your name”, “Your details: Your address”, “Your details: Your age”. Sounds stupid put together, doesn’t it?

To avoid all of the problems described here, all you need to do is one thing. Once the form is finished, read aloud the chosen LEGEND and each text label in its FIELDSET, as a single sentence. If it doesn’t make perfect sense, think again.