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. Advertisements

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:
    731
    tshad
    Apr 15, 2005
  2. gencode
    Replies:
    4
    Views:
    10,406
    gencode
    Nov 8, 2005
  3. Replies:
    0
    Views:
    980
  4. AleXmanFree
    Replies:
    3
    Views:
    793
    Hillbilly
    Oct 9, 2008
  5. Elton Wang

    Datagrid Edit, Insert & Update Checkbox (ASP.NET Using VB.NET)

    Elton Wang, Apr 7, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    1,024
    Elton Wang
    Apr 7, 2005
  6. Brian Miller
    Replies:
    6
    Views:
    1,346
    Brian Miller
    Nov 18, 2004
  7. Imran Aziz

    checkbox value attribute in checkbox control ?

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