RadioButton控制一列的TextBox禁用或者启用,如图:
如图:

当一列上面的RadioButton按下后,其它列的TextBox禁用。
我这样写有点笨了,哪位大神能帮忙修改的简单些?

当一列上面的RadioButton按下后,其它列的TextBox禁用。
<table width="90%" border="0" align="center" cellpadding="1">
<tr>
<td class="auto-style6" style="text-decoration: underline">Cations</td>
<td class="auto-style3"><asp:RadioButton runat="server" ID="C_V1" Text="mg/L" GroupName="1" onClick="radionCheck(this)"></asp:RadioButton></td>
<td class="auto-style4"><asp:RadioButton runat="server" ID="C_V2" Text="ppmm CaCo3" GroupName="1" onClick="radionCheck(this)"></asp:RadioButton></td>
<td class="auto-style5"><asp:RadioButton runat="server" ID="C_V3" Text="meg/L" GroupName="1" onClick="radionCheck(this)"></asp:RadioButton></td>
<td width="672"><asp:RadioButton runat="server" ID="C_V4" Text="mmol/L" GroupName="1" onClick="radionCheck(this)"></asp:RadioButton></td>
</tr>
<tr>
<td align="right" class="auto-style6">Ammonium(NH4+)</td>
<td class="auto-style3">
<asp:TextBox ID="A_1" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4">
<asp:TextBox ID="B_1" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5">
<asp:TextBox ID="C_1" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td>
<asp:TextBox ID="D_1" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="auto-style6">Potassium(K+)</td>
<td class="auto-style3">
<asp:TextBox ID="A_2" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4"> <asp:TextBox ID="B_2" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5"> <asp:TextBox ID="C_2" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td><asp:TextBox ID="D_2" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="auto-style6">Sodium(Na+)</td>
<td class="auto-style3">
<asp:TextBox ID="A_3" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4"> <asp:TextBox ID="B_3" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5"> <asp:TextBox ID="C_3" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td><asp:TextBox ID="D_3" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="auto-style6">Magnesium(Mg2+)</td>
<td class="auto-style3">
<asp:TextBox ID="A_4" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4"> <asp:TextBox ID="B_4" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5"> <asp:TextBox ID="C_4" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td><asp:TextBox ID="D_4" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="auto-style6" style="color: #FF0000">*Calcium(Ca2+)</td>
<td class="auto-style3">
<asp:TextBox ID="A_5" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4"> <asp:TextBox ID="B_5" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5"> <asp:TextBox ID="C_5" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td><asp:TextBox ID="D_5" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="auto-style6">Strontium(Sr2+)</td>
<td class="auto-style3">
<asp:TextBox ID="A_6" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4"> <asp:TextBox ID="B_6" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5"> <asp:TextBox ID="C_6" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td><asp:TextBox ID="D_6" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="auto-style6">Barium(Ba2+)</td>
<td class="auto-style3">
<asp:TextBox ID="A_7" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4"> <asp:TextBox ID="B_7" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5"> <asp:TextBox ID="C_7" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td><asp:TextBox ID="D_7" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="auto-style6">Fe +x</td>
<td class="auto-style3">
<asp:TextBox ID="A_8" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4"> <asp:TextBox ID="B_8" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5"> <asp:TextBox ID="C_8" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td><asp:TextBox ID="D_8" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="auto-style6">Mn +x</td>
<td class="auto-style3">
<asp:TextBox ID="A_9" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4"> <asp:TextBox ID="B_9" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5"> <asp:TextBox ID="C_9" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td><asp:TextBox ID="D_9" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="auto-style6">Al 3+</td>
<td class="auto-style3">
<asp:TextBox ID="A_10" runat="server" MaxLength="22" value="0.000"></asp:TextBox>
</td>
<td class="auto-style4"> <asp:TextBox ID="B_10" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td class="auto-style5"> <asp:TextBox ID="C_10" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
<td><asp:TextBox ID="D_10" runat="server" MaxLength="22" value="0.000"></asp:TextBox></td>
</tr>
</table><script type="text/javascript">
function radionCheck(radioID) {
if (document.getElementById("C_V1").checked == true) {
document.getElementById('A_1').disabled = false;
document.getElementById('B_1').disabled = true;
document.getElementById('C_1').disabled = true;
document.getElementById('D_1').disabled = true;
document.getElementById('B_2').disabled = true;
document.getElementById('C_2').disabled = true;
}
else if (document.getElementById("C_V2").checked == true) {
}
else if (document.getElementById("C_V3").checked == true) {
}
else (document.getElementById("C_V4").checked == true) {
}
}
</script> 我这样写有点笨了,哪位大神能帮忙修改的简单些?
...全文
相关推荐
常用控件的使用(Button、TextBox、ComboBox、ListBox等)
#### 文本框控件(TextBox)- **功能**:用于接收用户输入的数据。- **主要属性**: - `Text`:设置或获取文本框中的文本。
应对考试的一些知识点
使用 TextBox, RadioButton 和 DateTimePicker 控件- **TextBox**:用于输入或显示文本。
c#网络应用编程基础第05章习题解答.pdf
- **RadioButton**:强制单一选择,同一组内的RadioButton只能选中一个,选中一个则会取消其他同组内的选中状态。5.
MVC_HtmlHelper用法大全
在实际开发中,开发者应当根据具体的需求选择合适的HtmlHelper方法,或者根据需要扩展自定义的HtmlHelper方法来满足更加复杂的需求。
ASP—单元三 Web服务器控件.pdf
本单元主要介绍了Label、TextBox、Button、RadioButton、RadioButtonList、CheckBox、CheckBoxList、DropDownList和ListBox以及


