Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Checkbox Disabled

$
0
0
Hi,

My page was created with a multiview which has 3 views.

Now on one of the view I have a checkbox called chkpeer. So, when this checkbox is checked it triggers a submit button to be set to visible and active with the code below;

Code:

  Protected Sub chkpeer_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkpeer.CheckedChanged

        If chkpeer.Checked = True Then
            chkpeer.Enabled = True
            btnSub.Visible = True
        Else
            btnSub.Visible = False
        End If

    End Sub

The asp code is
Code:

<asp:CheckBox ID="chkpeer" runat="server" CssClass="checkbox" AutoPostBack = "True"  />
Now the problem is, when I check chkpeer - btnsub becomes visible set to TRUE. Then when I move to the next View without clicking the submit button then return to the view with chkpeer,

1) chkpeer is still ticked but disabled
2) btnsub visible is SET to FALSE.

I would prefer one of the following

Either have the chkpeer checked - enabled and btnSub still Visible (Ideally)
Or Chkpeer unchecked and enabled so that when I check it again it activates the btnSub ..

Please help!! Thank you

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>