OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Dynamic Forms Select List label association issue #7876

Open mwentz opened 6 years ago

mwentz commented 6 years ago

In the Dynamic Forms Select List template there is a rule that grabs the name value if there is no HtmlId set. That value is used for the for attribute of the label tag. If a name with spaces is used there is a mismatch between the label for attribute and the select id attribute. The id replaces the spaces with underscores, but the for does not.

Example: Name (set in CMS): "Some Select List" Code:

<label for="Some Select List">...
<select id="Some_Select_List"...
sebastienros commented 6 years ago

Missing some @Html.IdFor