MyBB Community Forums

Full Version: Search Box for 1.6
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I want to add a nice search box to my header to the right of my logo. I tried many codes I've found, but none makes the search box align to the right with the logo properly.

Can anyone please give me a search box code so it will fit in my header properly?
Use;
<div style="float: right; width:313; height:55">YOUR_SEARCH_BOX_CODE_GOES_HERE</div>

adjust width and height to suite your needs.
It works well, but I want the bar to be at the bottom of the header not at the top. Any ideas?

Also, how can I have the magnifying-glass image inside the search box like the MyBB Forums search box?


EDIT: Guess it was easier than I thought - added some <br /> and now it looks great. I still wanna know how to have the magnifying-glass image inside my box though.
So I got a code to make my search button an image, but it doesn't show up correctly for some reason. Notice how the image is a bit above the search bar:

[Image: 85901344.jpg]

Here's the code I'm using:
<div style="float:right;">
<br /><br /><br />
<form action="{$mybb->settings['bburl']}/search.php" method="post">
<input type="hidden" name="action" value="do_search" />
<input type="hidden" name="postthread" value="1" />
<input type="hidden" name="forums" value="all" />
<input type="hidden" name="showresults" value="threads" />
<input name="keywords" class="textboxcontainer" id="search_box" title="Enter your search keywords" type="text" />
<input type="image" class="searchbutton" src="/forums/images/twilight/search.png" name="submit" alt="Submit">
<input type="hidden" name="action" value="do_search" />
</form>
</div>

Any ideas how to align the search image to the textbox?
Hi there.

<div style="float:right;">
<br /><br /><br />
<form action="{$mybb->settings['bburl']}/search.php" method="post">
<input type="hidden" name="action" value="do_search" />
<input type="hidden" name="postthread" value="1" />
<input type="hidden" name="forums" value="all" />
<input type="hidden" name="showresults" value="threads" />
<input name="keywords" class="textboxcontainer" id="search_box" title="Enter your search keywords" type="text" />
<input type="image" class="searchbutton" src="/forums/images/twilight/search.png" name="submit" alt="Submit" style="margin-bottom: -4px;">
<input type="hidden" name="action" value="do_search" />
</form>
</div>

Try out the above code. Smile
(2010-10-06, 09:19 AM)trilobyte- Wrote: [ -> ]Hi there.

<div style="float:right;">
<br /><br /><br />
<form action="{$mybb->settings['bburl']}/search.php" method="post">
<input type="hidden" name="action" value="do_search" />
<input type="hidden" name="postthread" value="1" />
<input type="hidden" name="forums" value="all" />
<input type="hidden" name="showresults" value="threads" />
<input name="keywords" class="textboxcontainer" id="search_box" title="Enter your search keywords" type="text" />
<input type="image" class="searchbutton" src="/forums/images/twilight/search.png" name="submit" alt="Submit" style="margin-bottom: -4px;">
<input type="hidden" name="action" value="do_search" />
</form>
</div>

Try out the above code. Smile

Thank you, exactly what I needed.