• Hei,
    I am quite new to WordPress and slowly finding my way around. I integrated my search box into the navigation bar and also managed to edit the text in the box. But now I want the text to dissapear when the box comes in focus or when you click in it. I couldn’t figure that out so far.

    I use the Flaton Pro theme and this is the code I have in the searchform.php
    Thank you already for your help!

    <?php
    /**
    * The template for displaying search forms in Webulous
    *
    * @package Webulous
    */
    ?>
    <form role=”search” method=”get” id=”search_form” action=”<?php bloginfo(‘home’); ?>” />
    <input name=”s” type=”text” class=”search_input” id=”s” onfocus=”if (this.value == ‘type keywords & hit enter’) {this.value = ”;}” onblur=”if (this.value == ”) {this.value = ‘type keywords & hit enter’;}” value=”Search…” />
    <input type=”hidden” id=”searchsubmit” value=”Search” />

  • The topic ‘Search box text to disappear on focus’ is closed to new replies.