比如有1个TEXTBOX1,和一组RadioButton,当我TextBox1里输入为"1"时,RadioButton为可用,不填或者其他值时为不可用,请问怎么实现? JS吗?
解决方案 »
- 服务器端调试的问题
- e.NewSelectedIndex
- 请问winform用IrisSkin2换肤后,窗体内所有控件(如:按钮,Label等)的字体颜色都无法改变了,why?
- 100分了,该询问框如何写,解决问题的立即结帖。。。。。。
- 求一段好用的限制标题长度的
- 菜鳥程序問題
- 在ASP.NET中怎样把excel中的数据导入sqlServer2000和把sqlServer2000中的数据生成excel?
- Visual studio 2008 代码编辑器配色方案
- 急救命!调试后出现的怪问题
- 急! 怎么做一个弹出的信息框呢?
- 【请教】gridview中怎么根据bool类型显示"是"或"否"
- 讨论dhtmlxScheduler的使用
{
document.getElementById('<%=RaidoButton1.ClientID %>').disabled = false;
}
<script type="text/javascript">
function textChange(obj) {
var a = document.getElementById("RadioButton1");
if (event.keyCode == 49) {
a.setAttribute("disabled", "disabled");
}
else {
a.removeAttribute("disabled");
}
}
</script><asp:TextBox ID="TextBox1" runat="server" onkeypress="textChange(this)"></asp:TextBox>
<asp:RadioButton ID="RadioButton1" runat="server" Text="RadioButton1"/>
<asp:RadioButton ID="RadioButton1" runat="server" Text="RadioButton1"/>
<script type="text/javascript">
function textChange(obj) {
var a = document.getElementById("RadioButton1");
if (event.keyCode !=49) {
a.setAttribute("disabled", "disabled");
}
else {
a.removeAttribute("disabled");
}
}
</script>
那事件就要用onchange了,然后
var b=.getElementById("TextBox1");
if(b.value=="哈哈")
{
......
}