Search Box - with clear

<div id="main_search">
<form method="get" id="search_form" action="<?php bloginfo('url'); ?>/" >

<input type="text" class="search_field" value="Search Keywords" name="s" id="s" onfocus="if (this.value == 'Search Keywords') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search Keywords';}" />

<input type="submit" id="submit_button" name="submit" value="Submit" />

<!-- Replace the submit input above with this for a custom image --

<input type="image" id="submit_button" src="/graphics/search_btn.png" name="submit" value="Submit" />

-->

</form>
</div>

 

<!-- Here is an inline technique to handle the clear -->

<input type="text" name="search_query" id="search_query" value="SEARCH" onfocus="if (this.value == 'SEARCH') {this.value = '';}" onblur="if (this.value == '') {this.value = 'SEARCH';}"/>

0 Comments

You must be logged in to post a comment.