I have three questions. I created javascript to hide an asp.net label. Please see below. I have an onClientClick event connected to an enter button and a radio button. The radio button did not work at all. Clicking the enter button worked but triggered a postback returning the value back to the default.
1) Is it possible to use an onClientClick event with a radio button?
2) How do I avoid a postback with the onClientClick event?
3) If I were to render the label not visible using server side script on page load:
asp:Label id="panel4lbl2" text="state:" style="display:block" visible="false" runat="server"/>
could I use javascript to make it visible triggered by an onClientClick event?
Thanks
Code:
--------------------------------------------------------
Sam HobbsPosted Mar 20, 2011, 11:37 PM
- To keep threads from becoming unmanageably large
- So that replies can be marked as answers
- To help others seeking answers in the future
Note that the larger a thread is, the less likely you are to get answers.Craig DavisPosted Mar 20, 2011, 9:05 PM
Craig DavisPosted Mar 20, 2011, 8:44 PM
Suthish NairPosted Mar 20, 2011, 4:10 PM
remove OnClientClick events.
On Page Load
checkjava.Attributes.Add("onclick", String.Format("document.getElementById('{0}').style.display='none'", panel4lbl2.ClientID));