MyBB Community Forums

Full Version: fix search bar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a search bar built into my menu and it won't search. I don't know what codes to add inside here to make it search after because there's no links. Can anyone help me?

Search Bar HTML Code:
<li class="nav-search">
        <form action="#">
                <input type="text" placeholder="Search...">
                <input type="submit" value="">
        </form>
</li>
Website: http://ComingSoon.VisualizeEdits.com/

Update:
I fixed the code a little I think but it's not searching the terms I entered into the search box. Any suggestions?

<form method="post" action="search.php">
        <input type="text" value="Search..." onblur="if(value=='') value = 'Search...'"   onfocus="if(value=='Search...') value = ''" />
        <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 type="submit" value="">
</form>
you can add <input type="text" class="textbox" name="keywords" value="" /> in the search form code.
does it improve search results ?
(2013-07-25, 05:59 AM).m. Wrote: [ -> ]you can add <input type="text" class="textbox" name="keywords" value="" /> in the search form code.
does it improve search results ?

Yes, worked perfectly after adding the following code:

<li class="nav-search">
        <form method="post" action="search.php">
                <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 placeholder="Search here..." type="text" name="keywords" value="" />
                <input type="submit" value="" />
        </form>
</li>

Thank you .m.!