按你说的方式测试,问题存在
解决方法
打开admin/exam/ks.sj.aspx
找到
<tr>
<td align="right" class="lefttd" height="30" style="width: 102px"><strong>开考时间限制:</strong></td>
<td class="righttd">
<asp:RadioButtonList ID="RdbLimitDate" runat="server"
RepeatDirection="Horizontal" AutoPostBack="True"
onselectedindexchanged="RdbLimitDate_SelectedIndexChanged" RepeatLayout="Flow">
<asp:ListItem Value="1">启用</asp:ListItem>
<asp:ListItem Value="0" Selected="True">不启用</asp:ListItem>
</asp:RadioButtonList>
<span visible="false" id="beginenddate" runat="server">
<script> isHour = 1;</script>
有效期:从<asp:TextBox CssClass="textbox" ID="TxtBeginTime" runat="server" Width="120"></asp:TextBox> 至 <asp:TextBox CssClass="textbox" ID="TxtEndTime" runat="server" Width="120"></asp:TextBox>
</span>
</td>
</tr>
改成
<tr>
<td align="right" class="lefttd" height="30" style="width: 102px"><strong>开考时间限制:</strong></td>
<td class="righttd">
<asp:RadioButtonList ID="RdbLimitDate" runat="server"
RepeatDirection="Horizontal" on click="showvaliddate()";
RepeatLayout="Flow">
<asp:ListItem Value="1">启用</asp:ListItem>
<asp:ListItem Value="0" Selected="True">不启用</asp:ListItem>
</asp:RadioButtonList>
<span style="display:none" id="beginenddate" runat="server"></span>
<span style="display:none" id="datearea">
<script> isHour = 1;</script>
有效期:从<asp:TextBox CssClass="textbox" ID="TxtBeginTime" runat="server" Width="120"></asp:TextBox> 至 <asp:TextBox CssClass="textbox" ID="TxtEndTime" runat="server" Width="120"></asp:TextBox>
</span>
<script>
jQuery(document).ready(function () {
showvaliddate();
});
function showvaliddate() {
var checkrad = jQuery("#<%=this.RdbLimitDate.ClientID %> :radio[checked]").val();
if (checkrad == "1") {
jQuery("#datearea").show();
} else {
jQuery("#datearea").hide();
}
}
</script>
</td>
</tr>
上面的on click改成 onclick