ASP.NET Checkboxes

Discussion in 'ASP .Net' started by Tracey, Jul 23, 2003.

  1. Tracey

    Tracey Guest

    Thanx M, and I mean that, but I really need this to work
    without a postback and frankly it should behave like the
    other controls are behaving (correctly). This smells like
    a bug to me and I just wanted to get some sort of
    confirmation from the field or refutation with some sort
    of an explaination. Can you reproduce the problem? I have
    found a way around it for now by encasing the checkboxes
    in an <asp:Table> then disabling/enabling the table
    instead, which thankfully works. Thanx again M.

    >-----Original Message-----
    >hi Tracey
    >
    >try seting 'AutoPostBack' property for the controls to

    true and then try
    >again. your code will look somethnig like this
    >
    ><form id="frmTest" method="post" runat="server">
    >
    ><asp:CheckBox ID="chkTest" Runat="server" Enabled="False"

    Text="chkTest"
    >AutoPostBack="True"></asp:CheckBox>
    >
    ><asp:TextBox ID="txtTest" Runat="server" Enabled="False"
    >>txtTest</asp:TextBox>

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

    Text="chkTryIt"
    >AutoPostBack="True"></asp:CheckBox>
    >
    ></form>
    >
    >M
    >
    >"Tracey" <> wrote in message
    >news:00f301c35133$d6f1ab10$...
    >> 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
    >>

    >
    >
    >---
    >Outgoing mail is certified Virus Free.
    >Checked by AVG anti-virus system (http://www.grisoft.com).
    >Version: 6.0.502 / Virus Database: 300 - Release Date:

    7/18/2003
    >
    >
    >.
    >
    Tracey, Jul 23, 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. Randy Rubin

    CheckBoxes & DataGrids ASP.net

    Randy Rubin, Jul 15, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    488
    S. Justin Gengo
    Jul 15, 2004
  2. Replies:
    0
    Views:
    5,550
  3. joebob8000
    Replies:
    0
    Views:
    1,076
    joebob8000
    Dec 4, 2006
  4. Replies:
    2
    Views:
    525
  5. Sylvie
    Replies:
    0
    Views:
    424
    Sylvie
    Oct 10, 2007
Loading...

Share This Page