Open jamesmacwhite opened 3 years ago
@jamesmacwhite Thanks for calling this out. I'll look into improving on this in a future release.
In the meantime, if you'd like to update this in your current setup, you can override that specific field template with the underlying HTML that you'd like to use: https://sprout.barrelstrengthdesign.com/docs/forms/template-overrides.html#customizing-templates
@BenParizek Thanks Ben. That's what I've done, but thought I'd flag it upstream.
Description (screenshots, logs, ...)
According to the HTML5 spec, a
<legend>
cannot be wrapped with a<div>
.https://github.com/barrelstrength/craft-sprout-forms/blob/v3/src/templates/_components/formtemplates/accessible/field.twig https://github.com/barrelstrength/craft-sprout-forms/blob/v3/src/templates/_components/formtemplates/accessible/field.twig#L31-L49
The legend tag needs to immediately follow the fieldset as the first child element. The
heading
class could be applied to the label instead.https://html.spec.whatwg.org/multipage/form-elements.html#the-legend-element