|
-
February 8th, 2007, 08:21 AM
#1
[RESOLVED] a beginner
How do I do if I want a javascript that makes a lable visible or not depending on if a checkbox is clicked or not? I'm writing in c# and asp.net
-
February 8th, 2007, 09:00 AM
#2
Re: a beginner
You have to change the elements style.
Code:
<img src="path/to/image.jpg" id="theimg" style="display: none;">
<input type="button" value="Change" onclick="hideshow()">
<script language="JavaScript">
function hideshow(){
var obj = document.getElementById('theimg');
if(obj.style.display == "none"){obj.style.display = "block";}
else{obj.style.display = "none";}
}
</script>
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
February 9th, 2007, 08:53 AM
#3
Re: a beginner
And you won't need any server side programming to achieve it as shown on the example from PeejAvery.
-
February 10th, 2007, 09:39 AM
#4
Re: a beginner
Thanks I'll try it out today =). If I have anymore questions I'll be back!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|