WordPress.org

Support

Support » How-To and Troubleshooting » The Search Button

The Search Button

  • I’ve tried for ages to do this, and searched (I’m sure it was asked recently too) but to no avail.
    Right now, I have the default Search steup:
    INPUT words
    SEARCH button
    What I have been trying to do is get this:
    INPUT words | SEARCH button
    I have an appropriate sized .gif, but instead of it displaying inline (I have #searchform set for display:inline;) it displays underneath and at a much enlarged size.
    I’m lost right now on this – though I’ve a feeling I can’t see the wood for the trees !

Viewing 3 replies - 1 through 3 (of 3 total)
  • This is the code you need to modify, non?
    <form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
    <input type="text" name="s" style="width: 150px" />

    <input type="submit" name="submit" value="search" style="width: 152px" />
    </form>
    Take out the <input type="submit" name="submit" value="search" style="width: 152px" /> and replace it with your image enclosed in an anchor tag. add this in the a tag: href='javascript:document.searchform.submit();'. So it should look like this: <img src="http://whatever.com/image" alt="Search" name="subimg" />
    That should work.

    Thanks 🙂
    Is there any way to do this without the need for js ?

    Ha, yes I forgot. I made it harder than it has to be. Just add this line: src="url of image file" to your submit buttom. Voila!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The Search Button’ is closed to new replies.
Skip to toolbar