I have developed an application with forms. These forms are structured with fieldsets so you can see which input fields belong to a section. Each fieldset has a legend. The code looks like:
<fieldset>
<legend>Title</legend>
<label>Title: <input id="title" type="text"/></label>
<button>Create Object</button>
</fieldset>
Now we did a screenreader test, because we have blind users. We mentioned, that the screenreader (JAWS) reads the Title in legend
just as normal text. So it reads:"Title. Title. Input for title." However we expect sth like: "Caption Title. Title. Input for title."
The user said it would be better if the legend would be a caption so she can jump to section with a JAWL-command.
Now my question is: Is it allowed (HTML specification) to wrap the filedset-legend around a e.g. h3
tag? - Better question: Does it matter for an internal application, if I put a h3
-tag inside the legend
-tag even it is not w3c-conform?:
<fieldset>
<legend><h3>Title</h3></legend>
<label>Title: <input id="title" type="text"/></label>
<button>Create Object</button>
</fieldset>
If it is not allowed what would be your solution for this issue? Programming an customized fieldset?
The goal is that the screenreader makes a difference between legend-text and normal text when reading the page. How can I achieve this?