We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Option to add custom attributes to ee form tags

Feature Requests

Stefan Rechsteiner's avatar
Stefan Rechsteiner
442 posts
5 years ago
Stefan Rechsteiner's avatar Stefan Rechsteiner

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.

       
manjulaagarwal1955's avatar
manjulaagarwal1955
1 posts
5 years ago
manjulaagarwal1955's avatar manjulaagarwal1955

Facing same issue let we both find the solution.

       
Rob Allen's avatar
Rob Allen
2,950 posts
5 years ago
Rob Allen's avatar Rob Allen

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.

       
Stefan Rechsteiner's avatar
Stefan Rechsteiner
442 posts
5 years ago
Stefan Rechsteiner's avatar Stefan Rechsteiner

Yeah, thats the «workaround» I was describing in my first post. It’s ideal though. So the extension for custom attributes would be 👌🏼👌🏼👌🏼

       
Rob Allen's avatar
Rob Allen
2,950 posts
5 years ago
Rob Allen's avatar Rob Allen

Ah yes sorry missed you saying that!

Yes a good enhancement for any front end form that EE uses.

👍 1
       
Tom Jaeger's avatar
Tom Jaeger
228 posts
5 years ago
Tom Jaeger's avatar Tom Jaeger

I can see why this would be desirable… Raising this one with the team.

🚀 1
       
Tom Jaeger's avatar
Tom Jaeger
228 posts
5 years ago
Tom Jaeger's avatar Tom Jaeger

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.