Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide label based on checkbox

Status
Not open for further replies.

yeltom

Programmer
Sep 17, 2001
62
US
Hi, I am trying to hide a label when a checkbox is unhecked. I am trying to do this using javascript within a vb.net code behind page. I keep getting a syntax error and don't know where to make the changes.

Here is my sample code

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
chbShowHide.Attributes.Add("onClick", String.Format("javascript:showHide(this,'{0}')", txtShowHide.ClientID))
End Sub

Please help.
Thanks
 
try <input type="checkbox" runat="server" id="mycheck" />
instead of <asp:CheckBox and see if you get the same problem.
It does sound more like your javascript function showHide is broken though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top