我尝试了几种方法来让这个控件通过 508 合规性测试,但它们似乎都失败了。我没有得到测试人员的反馈,只有通过/失败。我怀疑这与在单选按钮周围自动呈现的表格有关。我怀疑标签必须在表格内,这不是 RadioButtonList 的选项。以下是我尝试过但失败的方法。
字段集/图例解决方案
ASP/NET 页面:
<fieldset>
<legend>Review By:</legend>
<asp:RadioButtonList runat="server" ID="FilterType" AutoPostBack="true" Width="100%"
BorderWidth="1" OnSelectedIndexChanged="FilterType_OnSelectedIndexChanged" />
</fieldset>
呈现的 HTML:
<fieldset>
<legend>Review By:</legend>
<table id="ctl00_contentBody_FilterType" border="0" style="border-width:1px;
border-style:solid;width:100%;">
<tr>
<td><input id="ctl00_contentBody_FilterType_0" type="radio"
name="ctl00$contentBody$FilterType" value="1"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$0
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_0">Attending MD</label>
</td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_1" type="radio"
name="ctl00$contentBody$FilterType" value="2"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$1
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_1">CERMe Review
Types</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_2" type="radio"
name="ctl00$contentBody$FilterType" value="3"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$2
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_2">Treating
Specialty</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_3" type="radio"
name="ctl00$contentBody$FilterType" value="4"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$3
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_3">Ward Location</label>
</td>
</tr>
</table>
</fieldset>
使用 AssociatedControlID 将控件链接到标签
ASP.Net 页面:
<asp:Label ID="lblHiddenReviewType" AssociatedControlID="FilterType" runat="server">
<div>Review Type:</div></asp:Label>
<asp:RadioButtonList runat="server" ID="FilterType" AutoPostBack="true" Width="100%"
BorderWidth="1" OnSelectedIndexChanged="FilterType_OnSelectedIndexChanged" />
呈现的 HTML:
<td>
<label for="ctl00_contentBody_FilterType"
id="ctl00_contentBody_lblHiddenReviewType"><div>Review Type:</div></label>
<table id="ctl00_contentBody_FilterType" border="0" style="border-
width:1px;border-style:solid;width:100%;">
<tr>
<td><input id="ctl00_contentBody_FilterType_0"
type="radio" name="ctl00$contentBody$FilterType" value="1"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$0
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_0">Attending MD</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_1"
type="radio" name="ctl00$contentBody$FilterType" value="2"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$1
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_1">CERMe Review Type</label>
</td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_2"
type="radio" name="ctl00$contentBody$FilterType" value="3"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$2
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_2">Treating
Specialty</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_3"
type="radio" name="ctl00$contentBody$FilterType" value="4"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$3
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_3">Ward Location</label>
</td>
</tr>
</table>
</td>
用自己的面板包围控件
ASP.Net 页面:
<asp:Panel id="pnlRadial" GroupingText="Review Type: " runat="server">
<asp:RadioButtonList runat="server" ID="FilterType" AutoPostBack="true" Width="100%"
BorderWidth="1" OnSelectedIndexChanged="FilterType_OnSelectedIndexChanged" />
</asp:Panel>
呈现的 HTML:
<div id="ctl00_contentBody_pnlRadial">
<fieldset>
<legend>Review Type:</legend>
<table id="ctl00_contentBody_FilterType" border="0" style="border-width:1px;border-
style:solid;width:100%;">
<tr>
<td><input id="ctl00_contentBody_FilterType_0" type="radio"
name="ctl00$contentBody$FilterType" value="1"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$0
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_0">Attending MD</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_1" type="radio"
name="ctl00$contentBody$FilterType" value="2"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$1
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_1">Reviewer</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_2" type="radio"
name="ctl00$contentBody$FilterType" value="4"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$2
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_2">Treating
Specialty</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_3" type="radio"
name="ctl00$contentBody$FilterType" value="5"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$3
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_3">Ward Location</label>
</td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_4" type="radio"
name="ctl00$contentBody$FilterType" value="3"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$4
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_4">Service Section</label>
</td>
</tr>
</table>
</fieldset>
</div>
任何帮助将不胜感激 !!