G
Guest
hey all,
is there a neater way to write the following javascript code? Basically
there just 3 controls on my webform a button,checkbox,radio button. if you
check the checkbox it just enables the radiobutton. the button is just there
for postback testing.
<script type="text/javascript">
var rb
var cxb
function InzSr(){
rb=document.getElementById("RadioButton1")
cxb=document.getElementById("CheckBox1")
rb.disabled=(cxb.checked==true)?false:true
}
function test(cxb){
rb.disabled=(cxb.checked==true)?false:true
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:CheckBox id="CheckBox1" runat="server"
onClick="test(this)"></asp:CheckBox>
<asp:RadioButton id="RadioButton1" runat="server"></asp:RadioButton></P>
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
<script type="text/javascript">InzSr();</script>
</form>
</body>
is there a neater way to write the following javascript code? Basically
there just 3 controls on my webform a button,checkbox,radio button. if you
check the checkbox it just enables the radiobutton. the button is just there
for postback testing.
<script type="text/javascript">
var rb
var cxb
function InzSr(){
rb=document.getElementById("RadioButton1")
cxb=document.getElementById("CheckBox1")
rb.disabled=(cxb.checked==true)?false:true
}
function test(cxb){
rb.disabled=(cxb.checked==true)?false:true
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:CheckBox id="CheckBox1" runat="server"
onClick="test(this)"></asp:CheckBox>
<asp:RadioButton id="RadioButton1" runat="server"></asp:RadioButton></P>
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
<script type="text/javascript">InzSr();</script>
</form>
</body>