WordPress.org

Ready to get started?Download WordPress

Forums

The Search Button (4 posts)

  1. Mark (podz)
    Support Maven
    Posted 10 years ago #

    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 !

  2. Anonymous
    Unregistered
    Posted 10 years ago #

    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.

  3. Mark (podz)
    Support Maven
    Posted 10 years ago #

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

  4. Anonymous
    Unregistered
    Posted 10 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.