Main Contents

Search, with no click

How do you style a search button?  They all look crap to me, and the default browser ones are all different.  So, my solution is to get rid of it.  Gone.  No button.    Heres how…

<?php $search_text = ‘Search MaggsWeb’; ?>
<form id=”searchForm” action=”search-results.php” method=”GET”>
<input name=”q” type=”text” class=”inputBox searchBox”
value=”<?php echo $search_text; ?>”
onblur=”if (this.value == ”)  { this.value = ‘<?php echo $search_text; ?>’; }”
onfocus=”if (this.value == ‘<?php echo $search_text; ?>’)  { this.value = ”; }”
/>
<input type=”hidden” id=”searchsubmit” />

Filed under: HTML, Javascript |

Leave a comment

Login