Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-19-2005, 09:44 PM   PM User | #1
Crash1hd
Regular Coder

 
Join Date: Jul 2002
Location: 51° 03' -78" N -114° 05' 72" W
Posts: 617
Thanks: 0
Thanked 0 Times in 0 Posts
Crash1hd is an unknown quantity at this point
visibility not showing

Hello all I am having trouble getting my div id box to show and hide here is the code

Code:
<a href="#" onclick="hideshow('search')">Search</a>
Code:
<script language="JavaScript">
	function hideshow(me){
		if (me.style.visibility=="hidden"){
			me.style.visibility="visible";
			}
		else {
			me.style.visibility="hidden";
			}
		}
</script>
<div id="search" class="tstyle">
<form method="GET" action="http://www.google.com/search">
	<input type=hidden name=ie value=UTF-8>
	<input type=hidden name=oe value=UTF-8>
	<input type=text name=q style="width:120px" maxlength=255 value="Google Search">
	<input type="submit" name="btnG" value="Search">
	<input type="hidden" name=domains value="lycosidea.com">
    <br />
    <input type="radio" name="sitesearch" value="">WWW
	<input type="radio" name="sitesearch" value="lycosidea.com" checked>Pod-Tours
</form>
</div>
Crash1hd is offline   Reply With Quote
Old 09-19-2005, 09:56 PM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,452
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
<script language="JavaScript">
function hideshow(me){
if (document.getElementById(me).style.visibility=="hidden"){
document.getElementById(me).style.visibility="visible";
}
else {
document.getElementById(me).style.visibility="hidden";
}
}
</script>
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 09-19-2005, 09:58 PM   PM User | #3
Crash1hd
Regular Coder

 
Join Date: Jul 2002
Location: 51° 03' -78" N -114° 05' 72" W
Posts: 617
Thanks: 0
Thanked 0 Times in 0 Posts
Crash1hd is an unknown quantity at this point
thankyou!
Crash1hd is offline   Reply With Quote
Old 09-20-2005, 02:58 AM   PM User | #4
CrAzY_J
Regular Coder

 
Join Date: May 2005
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
CrAzY_J is an unknown quantity at this point
or a little bit shorter:

Code:
function hideshow(me){
   getId(me).style.display=(getId(me).style.display=="none"))?"block":"none";
}
function getId(id){
   return document.getElementById(id)
}
CrAzY_J is offline   Reply With Quote
Old 09-28-2005, 10:29 AM   PM User | #5
Crash1hd
Regular Coder

 
Join Date: Jul 2002
Location: 51° 03' -78" N -114° 05' 72" W
Posts: 617
Thanks: 0
Thanked 0 Times in 0 Posts
Crash1hd is an unknown quantity at this point
Cool Thanks
Crash1hd is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:21 AM.


Advertisement
Log in to turn off these ads.