WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Initial Text in Search Box?

[Resolved] Initial Text in Search Box?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Mark Ratledge

    @songdogtech

    Forum Moderator

    This is what I use:

    <form id="searchform" method="get" action="<?php bloginfo('url'); ?>/"><input type="text" value="Search this site" onblur="if(this.value == '') {this.value = 'Search this site';}" onfocus="if(this.value == 'Search this site') {this.value = '';}" name="s" id="s" size="25" />
    
    <input type="submit" id="searchsubmit" value="Search" class="submit" name="searchsubmit"/></form>

    Style the text if you want:

    #searchform, input#s
    {
    color:#000;
    font-size: 1em;
    font-style: italic;
    }

    I have the following code on my search and wanted to achieve the same thing but somehow when I use the info above it does not working for me. I there something I miss?
    <form method=”get” id=”searchform” action=”” >
    <div>
    <input type=”text” value=”” />
    <input type=”submit” id=”searchsubmit” value=”” />
    </div>
    </form>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Initial Text in Search Box?’ is closed to new replies.