Posted By

Tate on 06/27/09


Tagged

javascript search wordpress


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

tobiasmay


Search form with onblur and onfocus text


 / Published in: PHP
 

  1. <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
  2. <input type="text" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" value="<?php if ($_REQUEST['s']) { the_search_query(); } else { echo 'To search, type and hit enter'; } ?>" name="s" id="s" />
  3. </form>

Report this snippet  

You need to login to post a comment.