WordPress.org

Ready to get started?Download WordPress

Forums

Search button to image (3 posts)

  1. alpha
    Member
    Posted 9 years ago #

    I know how to do this in 1.2 thanks to Podz's tutorial. However, the sarch code is different for 1.5

    Could anyone post a solution on how to convert the search button to an image on 1.5 in particular to this piece of code?

    '
    <form style="padding: 0px; margin-top: 0px; margin-bottom: 0px;" id="searchform" method="get" action="<?php bloginfo('url'); ?>">
    <div class="sidebartitle">Search</div>
    <p style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><input type="text" class="input" name="s" id="search" size="15" />
    <input name="submit" type="submit" tabindex="5" value="<?php _e('GO'); ?>" />
    </form>'

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    I just tried this on my site:
    <form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
    <div>
    <input type="text" alt="search" name="s" id="s" size="15" />
    <input type="image" src="http://www.tamba2.org.uk/T2/pix/buttonn.jpg" name="search" alt="Search" class="button" />
    </div>

    and it seems to work.

    I do not have a .button{} class in my css.
    If it doesn't work, post back and we'll figure it out :)

  3. alpha
    Member
    Posted 9 years ago #

    Actually, it worked well. All I had to do really in order to keep the format of the search bar was replace this line:

    '<input name="submit" type="submit" tabindex="5" value="<?php _e('GO'); ?>" />'

    with this line:

    '<input type="image" src="http://dommain.com/images/image.gif" name="search" alt="Search" class="button" />'

    Thanks, Podz!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.