WordPress.org

Support

Support » Themes and Templates » search field how to make text dissapear when clicked?

search field how to make text dissapear when clicked?

  • sophie

    @sophiewordpress5

    im a complete newbie, whats wrong with my searchform.php, when the search field is clicked, the text doesnt dissapear. my website is flipshion.com, thanks.

    searchform.php:

    <form method=”get” id=”searchform” action=”<?php bloginfo(‘url’); ?>/”>
    <div>
    <input type=”text” value=”S e a r c h F l i p s h i o n” name=”s” id=”s” onfocus=”if (this.value == ‘S e a r c h F l i p s h i o n) <input onfocus=”this.value = ”;}” onblur=”if (this.value == ”) {this.value = ‘S e a r c h F l i p s h i o n’;}” />
    </div>
    </form>

Viewing 3 replies - 1 through 3 (of 3 total)
  • <input type="text" value="S e a r c h   F l i p s h i o n" name="s" id="s" onfocus="if(this.value=='S e a r c h   F l i p s h i o n')this.value='';" onblur="if(this.value=='')this.value='S e a r c h   F l i p s h i o n'">
    sophie

    @sophiewordpress5

    thankyou so much raby works perfectly!!

    sophie

    @sophiewordpress5

    hey raby, do you know how i could put this search bar in the nav bar beside my links on the right side? please be specific about which files to edit since im a newbie.. thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘search field how to make text dissapear when clicked?’ is closed to new replies.