8
我不知道为什么,我不断收到此错误,同时检查我的网页在http://validator.w3.org/check 错误是:错误验证HTML:该为标签元素必须引用表单控件的属性
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>
我我相信我为我的label
提供了一个id参考,它为什么会一直关注这个错误?
<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>
谢谢。我知道了 ;) – Chan 2012-07-19 19:00:58