WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to change the submit button from "Search" to "Go" (10 posts)

  1. Tara
    Member
    Posted 4 years ago #

    hi everybody,

    Seeking guidance - how do I change the name of the search submit button from "Search" to "Go".

    Thanks.

    tara

  2. henkholland
    Member
    Posted 4 years ago #

    When your Searchbutton is in your left-sidebar go into your theme files and find left-sidebar.php in there find this:

    <form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <input type="text" name="s" id="s" size="19" /><input type="submit" value="<?php _e('Search'); ?>" />
    </form>

    and change Search to Go

  3. esmi
    Forum Moderator
    Posted 4 years ago #

    Create your own search form template (named searchform.php) and place it in your theme.

    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
    <div>
    <label for="s">Keyword(s)</label> <input class="text" type="text" value="<?php if(trim(wp_specialchars($s,1))!='') echo trim(wp_specialchars($s,1));else echo ' ';?>" name="s" id="s" />
    <input type="submit" class="submit" name="Submit" value="Search Site" />
    </div>
    </form>
  4. Tara
    Member
    Posted 4 years ago #

    Thanks esmi,excellent!

    I followed your suggestion. I works great.

    Question: How do i adjust the width of the search box? Does not matter what I do, It stays the same.

    in style.css, there is this:

    `#sidebar #searchform #s {
    width: 108px;
    padding: 2px;
    }`

    Even if I change that to zero, it does not change the width.

    I have moved the search from the sidebar (default theme) to the horizontal bar.

    Please guidee how I can change the width of the search box.

    Thanks esmi again.

    tara

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    #searchform #s .input{
    width: 50px;
    }

    does this do anything if added to your css?

    or...does adding a size value here do it?
    <label for="s">Keyword(s)</label> <input class="text" size ="20" type="text" value="<?php if(trim(wp_specialchars($s,1))!='') echo trim(wp_specialchars($s,1));else echo ' ';?>" name="s" id="s" />

  6. Tara
    Member
    Posted 4 years ago #

    Thanks RVoodoo,

    #

    searchform #s .input{
    width: 50px;
    }does this do anything if added to your css?

    adding size value does it.

    No.

    adding size value does it.

    Thanks again.

    tara

  7. esmi
    Forum Moderator
    Posted 4 years ago #

    Either something within the search form has a set width that is restricting the form's minimum width or it's something else within your CSS. Can you remind of your site's url again, please?

  8. Tara
    Member
    Posted 4 years ago #

    hi esmi,

    1) here is: http://www.gurbani.org

    2) I was just curious as to what exactly the following piece of code does

    value="<?php if(trim(wp_specialchars($s,1))!='') echo trim(wp_specialchars($s,1));else echo ' ';?>"

    3) also I tried add the following piece of code brfore or after the above piece, but NO success ("Search Blog does not appear in the search box).

    value="Search Blog" id="s" onfocus="if (this.value == 'Search Blog') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search Blog';}"

    thanks esmi

    tara

  9. esmi
    Forum Moderator
    Posted 4 years ago #

    1.It is the width on input#s that's affecting the searchform width. Try a width of 50px in:

    #s {
    -x-system-font:none;
    color:#AB99BC;
    font-family:Arial,Helvetica,sans-serif;
    font-size:12px;
    font-size-adjust:none;
    font-stretch:normal;
    font-style:normal;
    font-variant:normal;
    font-weight:normal;
    line-height:normal;
    padding:1px;
    width:140px;
    }

    then remember to do a hard refresh when viewing the updated page.

    2. It places the last term searched in the input box with any leading or trailing blank spaces removed.

  10. Tara
    Member
    Posted 4 years ago #

    Hi esmi,

    thanks a lot for your help and patient.

    I tried that solution

    Did not work - the search box size does not change with changing the width to even zero.

    tara

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.