Resetting text in search field after search
-
Hey people ??
I’m having some difficulties with my search field. I’d like it to contain the word “search” as default. When the use clicks the field, it should disappear. I got that part working. The thing that’s bothering me is this: When I type something in (i.e. “dog”) and press enter to search, the search results come up and everything is fine, but the search field then reads “dogsearch”.
I would like the search field to “reset” after a search and only contain the word “search”. How can I accomplish this?
This is my current code:
<form method="get" id="searchform" action="<?php bloginfo('home');?>/"> <h4 class="search"> <input type="text" value="<?php echo wp_specialchars($s, 1); ?>søg" onblur="if(this.value == '') {this.value = 'søg';}" onfocus="if(this.value == 'søg') {this.value = '';}" name="s" id="s" /> <input type="submit" id="searchsubmit" value="Search" /> </h4> </form>
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Resetting text in search field after search’ is closed to new replies.