Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > ASP.NET CheckBox Control

Reply
Thread Tools

ASP.NET CheckBox Control

 
 
Tracey
Guest
Posts: n/a
 
      07-22-2003
I have found that the <asp:checkbox> control is not
respecting the disabled attribute while the <asp:textbox>
and other controls are respecting it. Does anybody know if
this is a known bug and if so, what it's number is? Can
anybody else reproduce this problem? I've included some
simple code below. Here is the Form:

<form id="frmTest" method="post" runat="server">

<asp:CheckBox ID="chkTest" Runat="server" Enabled="False"
Text="chkTest"></asp:CheckBox>

<asp:TextBox ID="txtTest" Runat="server"
Enabled="False">txtTest</asp:TextBox>

<asp:CheckBox ID="chkTryIt" Runat="server" Enabled="True"
Text="chkTryIt"></asp:CheckBox>

</form>

And here is some client side script used to flip flop
between enabled and disabled. Notice how the textbox
respects the disabled attribute, but for some reason the
checkbox doesn't?

Sub chkTryIt_OnClick

document.getElementById("chkTest").disabled = _
(document.getElementById("chkTryIt").checked = False)

document.getElementById("chkTest").checked = _
(document.getElementById("chkTryIt").checked = True)

document.getElementById("txtTest").disabled = _
(document.getElementById("chkTryIt").checked = False)

End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASPNET CheckBox and a CheckBox in a TemplateField Jason Huang ASP .Net 0 06-29-2007 12:35 AM
DataGrid and embeded Checkbox..How to find if checkbox clicked =?Utf-8?B?RG90TmV0RGV2?= ASP .Net 1 10-06-2006 04:11 PM
disable checkbox list checkbox Vikram ASP .Net 1 01-25-2006 02:59 PM
checkbox value attribute in checkbox control ? Imran Aziz ASP .Net Web Controls 2 08-08-2005 11:12 AM
Text on Checkbox below the checkbox tshad ASP .Net 0 04-14-2005 11:26 PM



Advertisments