ASP.NET CheckBox Control

Discussion in 'ASP .Net Web Controls' started by Tracey, Jul 22, 2003.

  1. Tracey

    Tracey Guest

    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
     
    Tracey, Jul 22, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad
    Replies:
    0
    Views:
    577
    tshad
    Apr 15, 2005
  2. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,429
    ThunderMusic
    Jan 25, 2006
  3. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    864
    David Wier
    Oct 6, 2006
  4. Brian Miller
    Replies:
    6
    Views:
    810
    Brian Miller
    Nov 18, 2004
  5. Imran Aziz

    checkbox value attribute in checkbox control ?

    Imran Aziz, Aug 6, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    238
    Imran Aziz
    Aug 8, 2005
Loading...

Share This Page