It’s been long since I made changes to my wordpress blog site, this is what happens when you have free time as a programmer.
So, I just realized the submit button on the search form on the header is not really important, I hid it now by simply display: hidden;. Then, some text might help to indicate that that form above is used for search.
Here’s the code
1 2 3 4 5 6 7 | var changed = false; $('#searchform #s') .addClass('quiet').val('Search...') .bind('change', function(){ if ( !changed ) { changed = true; } } ) .bind('focus', function(){ $(this).removeClass('quiet'); if ( !changed ) { $(this).val(''); } } ) .bind('blur', function(){ if ( !changed ) { $(this).val('Search...'); $(this).addClass('quiet'); } } ); |
In wordpress, the search input field name is ‘s’, in case you find this helpful and want to use it, just replace the #searchform #s with your own selector. I might make this a plugin someday.