I don't know why I keep getting this error by checking my page for the http://validator.w3.org/check Error:
Line 46, Column 68: The for attribute of the label element must refer to a form control. <label class="environment-label" for="environment_form">Environments:</label>
I suppose I provided the id link for my label to an external form, why does it keep listening to me about this error?
<div> <form id="environment_form" method="post"> <div class="styled-select"> <label class="environment-label" for="environment_form">Environments:</label> <select name="environment_dropdown" onchange="selectionChanged()"> <option @(ViewData["selection"] == null || string.IsNullOrEmpty(ViewData["selection"].ToString()) ? "selected" : "")>select one</option> @foreach (string name in Model) { <option @(ViewData["selection"] != null && ViewData["selection"].Equals(name) ? "selected" : "")> @name </option> } </select> </div> </form> </div>
html html5 validation asp.net-mvc-3
Chan
source share