473,386 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

make webcontrol visible through checkbox


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.
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
1 1753
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 )

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: AFN | last post by:
I want to click a checkbox and have a 4 line (approx) paragraph appear beneath the checkbox, pushing the rest of the page down. And when unchecking the checkbox, the paragraph should disappear...
1
by: Novice | last post by:
Hey all, I have finally managed to create a Custom WebControl and am using a technique from another programmer to maintain state between pages - I would just like to validate this idea. ...
6
by: Patrick Olurotimi Ige | last post by:
I have a Datalist in a form with a hyperlink i would like to make the hyperlink visible only when a checkbox is clicked and not visible when not clicked . But doing this below in page_load it...
0
by: Gary Rynearson | last post by:
I have an aspx form that conatains a WebControls.Table object. I also have a class inheriting from the WebControl class. That class is instantiated using the Table as a parameter, and adds...
4
by: Cesar Ronchese | last post by:
Hello. I have a WebForm that contains a Panel object. This panel, at design time is empty. When running, I need to create dinamically a Label and a WebControl (built from the same project). I...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
0
by: benfly08 | last post by:
Hi, guys. I'm developing a web application for Sales Department people in my company. I used my 1024X768 resolution and "Medium" IE text size to test my Layout and it worked fine. However, some...
8
by: gerry | last post by:
The PagerSettings.Visible property is not being handled properly by the GridView control. The value assigned to this property is not applied until after a postback. Simplest test : .aspx...
5
by: Sideburns | last post by:
I am trying to use a checkbox to make a textbox visible when checkbox=yes and invisible when the checkbox=no. I am not sure if this is the best way to go about this. It has been a while since I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.