我有与下拉列表相关的复选框列表和与单选按钮组相关的复选框。代码示例是这样的:
<table class="style1">
<tr>
<td class="style10" colspan="6">
</td>
</tr>
<tr>
<td class="style6">
<asp:CheckBox ID="chkBoxChanl" AutoPostBack="false"
runat="server" Text="Channel"
CssClass="ChkBoxStyle" Font-Size="Small"
/> </td>
<td class="style7">
<asp:DropDownList ID="ddlChannel" runat="server" CssClass="ddl">
</asp:DropDownList> </td>
<td class="style6">
<asp:CheckBox ID="chkBoxParty" runat="server" Text="Party"
CssClass="ChkBoxStyle" Font-Size="Small" /> </td>
<td class="style7">
<asp:DropDownList ID="ddlParty" runat="server" CssClass="ddl">
</asp:DropDownList> </td>
<td class="style13">
<asp:CheckBox ID="chkBoxContntTyp" runat="server" Font-Bold="True"
Text="Content Type" CssClass="ChkBoxStyle" Font-Size="Small"/> </td>
<td class="style8" rowspan="2">
<asp:RadioButton ID="rdBtnNews" runat="server" Text="News" CssClass="RadioGroup" />
<asp:RadioButton ID="rdBtnTicker" runat="server" Text="Ticker" CssClass="RadioGroup" /> <asp:RadioButton ID="rdBtnBreakingNews"
runat="server" Text="Breaking News" CssClass="RadioGroup" />
</br></br><asp:RadioButton ID="rdBtnBeeper" runat="server" Text="Beeper" CssClass="RadioGroup" /> <asp:RadioButton
ID="rdBtnTalkshow" runat="server" Text="TalkShow" CssClass="RadioGroup" /></td>
</tr>
<tr>
<td class="style6">
<asp:CheckBox ID="chkBoxDate" runat="server" Font-Bold="True" Text="Date"
CssClass="ChkBoxStyle" Font-Size="Small" /> </td>
<td class="style7">
<asp:TextBox ID="tbFrom" runat="server" CssClass="tbDate"></asp:TextBox><asp:Label ID="Label5"
runat="server" Text="To"></asp:Label><asp:TextBox ID="tbTo"
runat="server" CssClass="tbDate"></asp:TextBox> </td>
<td class="style6">
<asp:CheckBox ID="chkBoxPerson" runat="server" Font-Bold="True" Text="Person"
CssClass="ChkBoxStyle" Font-Size="Small" /> </td>
<td class="style7">
<asp:DropDownList ID="ddlPerson" runat="server" CssClass="ddl">
</asp:DropDownList> </td>
<td class="style13">
</td>
</tr>
<tr>
<td class="style4">
<asp:CheckBox ID="chkBoxProgrm" runat="server" Font-Bold="True"
Text="Program" CssClass="ChkBoxStyle" Font-Size="Small"/> </td>
<td class="style3">
<asp:DropDownList ID="ddlProgram" runat="server" CssClass="ddl">
</asp:DropDownList> </td>
<td class="style5">
<asp:CheckBox ID="chkBoxProvince" runat="server" Font-Bold="True"
Text="Province" CssClass="ChkBoxStyle" Font-Size="Small"/> </td>
<td class="style3">
<asp:DropDownList ID="ddlProvince" runat="server" CssClass="ddl">
</asp:DropDownList> </td>
<td class="style18">
<asp:CheckBox ID="chkContentTone" runat="server" Font-Bold="True"
Text="Content Tone" CssClass="ChkBoxStyle" Font-Size="Small"/> </td>
<td class="style9">
<asp:RadioButton ID="rdBtnPositive" runat="server" Text="Positive" CssClass="RadioGroup" /> <asp:RadioButton
ID="rdBtnNegative" runat="server" Text="Negative" CssClass="RadioGroup" /> <asp:RadioButton ID="rdBtnNeutral"
runat="server" Text="Neutral" CssClass="RadioGroup" /> </td>
</tr>
<tr>
<td class="style14">
<asp:Label ID="Label4" runat="server" Text="Keyword" Font-Names="Verdana,Arial"
Font-Bold="True" Font-Size="Small"></asp:Label> </td>
<td class="style15">
<asp:TextBox ID="tbKeyword" runat="server" CssClass="tb"></asp:TextBox> </td>
<td class="style14">
<asp:CheckBox ID="chkBoxCity" runat="server" Font-Bold="True" Text="City"
CssClass="ChkBoxStyle" Font-Size="Small"/> </td>
<td class="style15">
<asp:DropDownList ID="ddlCity" runat="server" CssClass="ddl">
</asp:DropDownList> </td>
<td class="style16">
</td>
<td class="style17">
<asp:Button ID="Button1" runat="server" Text="Search" CssClass="button" />
<asp:Button ID="Button2"
runat="server" Text="Report" CssClass="button" /></td>
</tr>
</table>
如下所示。
但我想在页面加载时禁用所有下拉列表和单选按钮,当我选中复选框时,只启用相关的下拉列表或复选框组。像这样。 当我选中复选框(内容类型)时,单选按钮组会像这样启用。 我希望当我选中任何复选框时,相关的下拉列表或单选按钮组就会启用。我想要的所有这些都在客户端(服务器端是我已经知道的不好的做法)java脚本。任何想法,因为我从过去 2 天开始搜索,但没有找到任何结果!