re: Adding <fieldset> lacks a <legend> element as first child HubSpot Forms

During ADA compliance scan, HubSpot forms trigger the following message:
///

Checks that a <legend> element is present as the first element within a <fieldset> element. When grouping a set of form fields using a <fieldset> element, include a <legend> element to describe the grouping.

Recommended Action

Add a descriptive <legend> element as the first child within the [fieldset] element to describe the grouping. For example: <fieldset><legend>Pizza toppings</legend>…</fieldset>.

///

Can this be added to HubSpot forms, it is there for all other fields, just missing in the top level for the whole form.

Hello @JGat3s
Add <legend> element on top level of HS form and in HTML section add the code. Replace form title with your title. After publishing this it will be labeled according to your chosen title.

<fieldset>
 <legend>Form title</legend>
 <!-- Your form fields go here -->
</fieldset>

Thank you so much for your reply. I am unclear as to where I can add this. The default HubSpot form builder does not allow me to edit HTML directly. In addition, when I view the template of a page that has a form installed, I am unable to edit the module. It is set to read-only. Any insights on this?

We observe a similar issue with the issues:

  1. “Too many <legend> in <fieldset> element”
  2. “Ensure that the <legend> is not empty”

We’re using the HubSpot forms’ embedding options, and I can’t find a way to change how the HTML is rendered using this method. Is there a way to improve this on HubSpot’s side by optimizing the rendered embed to comply with it?