make webcontrol visible through checkbox

B

Beffmans

hi

I am trying to make this label visible through a checkbox. I try to make
use of javascript but what am I doing wrong?

<HTML>
<HEAD>
<title>WebForm1</title>
<script>

function f_check()
{
if (document.getElementById("CheckBox1").checked)
return true;
else
return false;


}

</script>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 80px; POSITION:
absolute; TOP: 48px" runat="server"
Width="160px" Height="16px" Visible="javascript:f_check();">hello
there!!!!</asp:Label>
<asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 264px; POSITION:
absolute; TOP: 48px" runat="server"
Text="is label visible or not?"></asp:Button>
<asp:CheckBox id="CheckBox1" style="Z-INDEX: 103; LEFT: 80px;
POSITION: absolute; TOP: 88px" runat="server"
AutoPostBack="True"></asp:CheckBox>
</form>
</body>
</HTML>

thanks

B.
 
M

Marcel

Dear B,

I think you should toggle the visibility property.
Checkout the clientid property documention aswell...

Hope this is helpfull to you.

Marcel van Eijkel
( www.vaneijkel.com )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top