Status
Not open for further replies.

tractor3231

Active Member
230
2010
5
0
I need help with html/javascript popup search on my site..
I want the search popup to close whenever I clicked outside the search popup..

Here is the search popup code;
Code:
<div class="searchtext">
<script language="javascript"> 
function toggle() {
var ele = document.getElementById("toggleText");
var text = document.getElementById("displayText");
if(ele.style.display == "block") {
    	 ele.style.display = "none";
text.innerHTML = "Search<img src='images/misc/menu_open.gif'>";
  	}
else {
ele.style.display = "block";
text.innerHTML = "Search<img src='images/misc/menu_open.gif'>";
}
} 
</script>

<a id="displayText" href="javascript:toggle();">Search<img src='images/misc/menu_open.gif'></a>
<div id="toggleText" class="searchbox" style="display: none; position:absolute;"><table class="searchbox" cellpadding="4" cellspacing="0" border="0">
<tr>
<td class="thead">Search Forums</td>
</tr>
<tr>
<td class="vbmenu_option" title="">
<form action="search.php?do=process" method="post">

<input type="hidden" name="do" value="process">
<input type="hidden" name="quicksearch" value="1">
<input type="hidden" name="childforums" value="1">
<input type="hidden" name="exactname" value="1">
<input type="hidden" name="s" value="">
<input type="hidden" name="securitytoken" value="1317376584-15cd3b184c4a7a023986a720e23261a0b2d0ec34">
<div><input type="text" class="bginput" name="query" size="25" tabindex="1001"><input type="submit" class="button" value="Go" tabindex="1004"></div>
<div style="margin-top:6px">
<label for="rb_nb_sp0"><input type="radio" name="showposts" value="0" id="rb_nb_sp0" tabindex="1002" checked="checked">Show Threads</label>

<label for="rb_nb_sp1"><input type="radio" name="showposts" value="1" id="rb_nb_sp1" tabindex="1003">Show Posts</label>
</div>
</form>
</td>
</tr>

<tr>
<td class="vbmenu_option vbmenu_option_alink"><a href="tags.php" rel="nofollow">Tag Search</a></td>
</tr>

<tr>
<td class="vbmenu_option vbmenu_option_alink"><a href="search.php" accesskey="4" rel="nofollow">Advanced Search</a></td>
</tr>

</table></div>

Site:
the search is on the right upper part of the site
http://dev-forums.onemodelplace.com/

TIA!
 
1 comment
Status
Not open for further replies.
Back
Top