Home  »     »     »  Simple customized Search form code for using Google Custom Search Engine (CSE) results hosted on Google

Simple customized Search form code for using Google Custom Search Engine (CSE) results hosted on Google

Wednesday, February 26, 2014



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>


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/



How to link to this page?
If you wish to link to this page from your website, simply Copy and paste the above HTML code to your web page. It will appear on your page as:
Simple customized Search form code for using Google Custom Search Engine (CSE) results hosted on Google.




Share this!




comments powered by Disqus

This Weeks 7 Popular Posts


Subscribe to Recent Posts by Email
Stay connected to CROZOOM with regular Email notices of new Techie articles and IT Jobs. Updates will be delivered to your Inbox as soon as they are posted online.

Enter Your Email Address:  

Delivered by FeedBurner   RSS Feed

Search this Blog   



Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »