Currently there is no way to add a role="search"
to a form-tag like {exp:search:simple_form}
. There is a workaround to add the role to a structural element containing or surrounding the ee-form-tag, but that’s not ideal.
It would be great if there was a way to add any kind of custom attributes (like role
and data-
and everything else) to all EE-Form-Tags.
I would welcome it, if there were a standardised way of passing custom attributes to EE-Form-Tags. One that is integrated everywhere in EE and on which AddOn-Developers could orient themselves. This standardised syntax would also reduce the need to remember different form-attributes-declarations for different tags/AddOns.
I agree extending form tags for additional attributes would be great to have, but in the meantime you could still add a role attribute to a container, outside or inside the form.
<section role="search">
<h2>Search</h2>
<form>...</form>
</section>
<form>
<div role="search">
</div>
</form>
https://adrianroselli.com/2015/08/where-to-put-your-search-role.html has some thoughts on the matter.
Ah yes sorry missed you saying that!
Yes a good enhancement for any front end form that EE uses.
Quick update for people tracking here. There was a lot of conversation in Slack about this. So we moved the discussion over to github for permanence.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.