Simple customized Search form code for using Google Custom Search Engine (CSE) results hosted on Google
If you have created personalised search engine using Google's Custom Search Engine (CSE) option through website http://www.google.com/cse/ , then you will be given a piece of code that need to be pasted on your website, on where you wish to see the Search box..
Google custom search results can be displayed in different modes
1. Display the result with in the page where you are displaying the Search Box
2. Display the result on a different page on your website
3. Display as frames
4. Display the result on a google hosted page.
If you are using the 4th option, ie, displaying the google custome search result on a google hosted page, use the following code to cretae the Custome search box.
<form action='http://google.com/cse' id='cse-search-box' target='_blank'>
<input name='cx' type='hidden' value='010414496501306016230:x0vzcyik-ik'/>
<input name='ie' type='hidden' value='UTF-8'/>
<input name='q' onblur='if(this.value == '') { this.value='Google Custom Search'}' onfocus='if (this.value == 'Google Custom Search') {this.value=''}' onClick='if (this.value == 'Google Custom Search') {this.value=''}' size='18' type='text' value='Google Custom Search' style="font-size:14px;color:blue"/>
<input name='sa' type='submit' value='Search'/>
</form>
<input name='cx' type='hidden' value='010414496501306016230:x0vzcyik-ik'/>
<input name='ie' type='hidden' value='UTF-8'/>
<input name='q' onblur='if(this.value == '') { this.value='Google Custom Search'}' onfocus='if (this.value == 'Google Custom Search') {this.value=''}' onClick='if (this.value == 'Google Custom Search') {this.value=''}' size='18' type='text' value='Google Custom Search' style="font-size:14px;color:blue"/>
<input name='sa' type='submit' value='Search'/>
</form>
Fields:
cx : Your custom search Engine Id
ie : Your encoding
q : Your search query
sa : Search button name
Here is how it works :)
Your request will be submitted to a Google page http://google.com/cse, where it is processed. Google checks its index for records matching the submitted key word. If found result is displayed.
SITE SEARCH
for more details, please logon to:
http://www.google.com/cse/