Adding simple google search

For those who have a bit larger of a website, you might consider adding a Google web search…

http://www.google.com/searchcode.html

I heavily modified their default code to integrate the search in my site.


<!-- SiteSearch Google -->
<form method="get" action="http://www.google.com/search">

<input type="text" name="q" size="14" maxlength="255" value="Search..." onblur="if(this.value=='') this.value='Search...';" onfocus="if(this.value=='Search...') this.value='';">

<input type="hidden" name="domains" value="www.carterlake.org"><input type="hidden" name="sitesearch" value="www.carterlake.org" checked>

</form>
<!-- SiteSearch Google -->

I took the disappearing “search…” text straight from Weather Watch’s main page. Good code there Chris!

Excellent Tom…

Always adding more capabilities to your site… Just Outstanding :slight_smile:

-Bob

Very cool. I’ve wanted to do something like that for a while but never looked in to it.

Below is a version of the same that will validate Xhtml

<form method="get" action="http://www.google.com/search">
 <input type="text" name="q" size="14" maxlength="255" value="Search..." 
   onblur="if(this.value=='') this.value='Search...';" 
   onfocus="if(this.value=='Search...') this.value='';"/>
 <input type="hidden" name="domains" value="www.tnetweather.com"/>
 <input type="hidden" name="sitesearch" value="www.tnetweather.com" checked="checked"/>
</form>

Indenting is not require, I just do it to see it better and shorten the lines a bit.

[quote author=krelvinaz link=topic=11862.msg90201#msg90201 date=1130256032]
Very cool.