Add a Buttonless Search Form in WordPress

WordPress

I love search forms.  But sometimes, designs call for forms to be placed in a tight space to save room for other elements or where buttons may look out of place.  If that’s the case, then you can add a special box that will allow users to search with the enter key (or the Done key on the iPhone).

Here’s the code:

<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<input type="text" placeholder="Search" name="s" id="s" />
<input type="hidden" id="searchsubmit" />
</form>

This drops in a stylable input field that has no button – all the user has to do is enter the text and hit enter or the done button – simple as that.

You can also style by applying CSS styling to “#s”