...

View Full Version : visibility not showing



Crash1hd
09-19-2005, 09:44 PM
Hello all I am having trouble getting my div id box to show and hide here is the code


<a href="#" onclick="hideshow('search')">Search</a>


<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>

felgall
09-19-2005, 09:56 PM
<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>

Crash1hd
09-19-2005, 09:58 PM
thankyou!

CrAzY_J
09-20-2005, 02:58 AM
or a little bit shorter:


function hideshow(me){
getId(me).style.display=(getId(me).style.display=="none"))?"block":"none";
}
function getId(id){
return document.getElementById(id)
}

Crash1hd
09-28-2005, 10:29 AM
Cool Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum