fcOnTheWeb Logo Web technologies, made easy.

fcOnTheWeb Red DotHow to add a Google search box to a web page

Adding a Google search box to your website is just about as easy it was to add YouTube videos to your website. After a little bit of digging around the Google site, we find that Google is giving away the code to add the search box to your site!

http://www.google.com/coop/cse/onthefly

This is the code Google gives us:

<!-- Use of this code assumes agreement with the Google Custom Search Terms of Service. -->

<!-- The terms of service are available at /coop/docs/cse/tos.html -->

<form name="cse" id="searchbox_demo" action="http://www.google.com/cse">

<input type="hidden" name="cref" value="" />

<input type="hidden" name="ie" value="utf-8" />

<input type="hidden" name="hl" value="" />

<input name="q" type="text" size="40" />

<input type="submit" name="sa" value="Search" />

</form>

<script type="text/javascript" src="http://www.google.com/cse/tools/onthefly?form=searchbox_demo&lang=">
</script>

And now adding the Google search bar to your web page is as easy as pasting that code in where you want it. The way it appears on the page is shown below:

Customising the search box (a little, within Google's guidelines - these guidelines, and these ones...) is easy too. What we are going to do is style the button to match the others on our site and change the text on the button.

To style the button, we simply add out predefined class: class="form_button". And to change the text we simply change the value attribute to be whatever we want. It looks like this:

<input type="submit" name="sa" value="Search with Google" class="form_button" />

So our implementation can be found on our search page, and looks like this:

The logo does not show in this box and the box does not actually work specifically to our site because Google's JavaScript does not work with more than one instance of the search bar on any one page. We can't edit the JavaScript, so there is not much that can be done about that. But as long as you do not have more than one instance on a page, it will be fine.

Google gets its search results from pages linked to by the page the search is on, as well as its cached results for that domain. So, the search on this article page in particular is inaccurate as it brings up a host of results from Google itself, due to the preceeding links to Google in the text. However, the one implemented on our Search page does a much better job of it.

To finish off, it is worth noting that Google provides a lot more options through its paid service, Google Site Search. These features allow you to keep the search results on your domain, add a custom header and style the results to match your theme - but it comes with a price.

ferrari_chris

Harua Ishaq (http://inyass4ishaq.gnbo.com.ng) says:

2012-08-10 09:01:46

adding of a google search page to mu web site

__________

Cheap Ralph Lauren UK (http://cheapralphlaurenuk.1minutesite.co.uk/) says:

2014-01-18 03:02:51

Gucci Shoes UK, http://www.guccivshoesfactory.net/
Polo Ralph Lauren Outlet Online, http://www.rralphlaurenoutlet.com/
Ralph Lauren Outlet Online, http://www.ralphlaurenipolo.com/
Ralph Lauren UK, http://www.polo-outletstoreonline.com/
Beats by Dre, http://www.discountbeatsbydresale.com/
Sacs Longchamp Pairs, http://www.saclongchamppairs.com/
Canada Goose Outlet, http://www.thecanadagooseoutlet.com/
Hollister UK Shops, http://www.cheaphollistersale.co.uk/
Michael Kors Outlet Online, http://www.michaelkors.so/
Marc Jacobs Outlet, http://www.marcjacobsonsale.com/
Michael Kors Outlet, http://www.michaelkorsr.com/
North Jackets Clearance, http://www.north-faceoutletonlines.net/
Burberry Outlet Online, http://www.burbagssale2013.com/
North Clearance Outlet Online, http://www.north-clearance.com/
Coach Factory, http://www.coach-factories.com/
Coach Outlet Online, http://www.coach-purseonsale.com/
Cheap Ralph Lauren UK, http://cheapralphlaurenuk.1minutesite.co.uk/
http://marcjacobsoutlet-2014.tripod.com/
http://www.michaelkorsoutletr.com/
Michael Kors Outlet
Discount Michael Kors
http://www.michael-korsfactorystore.com/
Michael Kors Outlet
Michael Kors Factory Store
http://www.michaellkorsfactoryonline.com/
Michael Kors Outlet
Discount micheal kors

__________

mbt usa (http://www.mbtiuk.com/) says:

2014-04-16 07:07:04

Mbt shoes are able to help you solve the problem of physical ache. When Legs and feet are twisted, when back and hips are ached, when joint and muscles or ligaments get hurt, mbt shoes are helpful to these pains\' recovery.

__________

cheap mbt shoes (http://www.mbtclearanceukoutlet.com) says:

2014-07-03 08:12:21

Brasilian pelaajat Scolari psykologinen epätasapaino psykiatri apua http://www.mbtclearanceukoutlet.com

__________

oakley sunglasses cheap (http://www.oakleysunglassescheap.us.com/) says:

2014-07-12 07:02:40

http://www.oakleysunglassescheap.us.com/ oakley sunglasses

cheap
http://www.coachoutletstoreonlineco.com/ coach factory outlet
http://www.abercrombie-andfitch.com/ abercrombie and fitch
http://www.michaelkors-outletsonline.com/ michael kors outlet
http://www.oakley-sunglassesoutlet.com/ oakley sunglasses

outlet
http://www.tory-burchoutlet.com/ tory burch outlet
http://www.abercrombieandfitchstore.com/ abercrombie & fitch
http://www.rayban--sunglasses.com/ ray ban sunglasses
http://www.fit-flops.co.uk/ fitflops
http://www.coachoutlet-factoryonline.com/ coach factory outlet
http://www.toryburch-shoes.com/ tory burch shoes
http://www.coachstoreonline.org/ coach outlet store online
http://www.coachfactory-outletinc.com/ coach factory outlet
http://www.cheapraybansunglasses.us/ cheap ray ban sunglasses
http://www.valentino.us.com/ valentino
http://www.fitfloponline.co.uk/ fitflop uk
http://www.coach-outletinc.com/ coach outlet
http://www.coachoutlet-factorystore.com/ coach outlet store

online
http://www.airjordan.us.com/ air jordan
http://www.timberlandshoesus.com/ timberland shoes
http://www.michaelkorsoutlet-online.us/ michael kors outlet
http://www.coachfactoryoutletnew.com/ coach factory outlet
http://www.coach-factoryoutletinc.com/ coach factory outlet
http://www.truereligionbrandjeans.us.com/ true religion outlet
http://www.truereligionjeans.us.com/ true religion jeans
http://www.coach--handbags.com/ coach outlet online
http://www.louisvuitton--outlet.us/ louis vuitton outlet
http://www.timberland--shoes.com/ timberland boots
http://www.isabelmarantshoes.us.com/ isabel marant shoes
http://www.coachoutletonline-factory.com/ coach outlet online
http://www.michaelkorsoutlet-online.net/ michael kors purses
http://www.louisvuitton-handbag.us/ louis vuitton handbags
http://www.coach-outletstoreonline.com/ coach outlet store

online
http://www.true-religion-jeans.com/ true religion jeans
http://www.coach-outletfactoryonline.com/ coach factory outlet

online
http://www.officialcoachfactoryoutlet.com/ coach factory outlet
http://www.louisvuitton-outlet.org/ louis vuitton outlet
http://www.coach-factoryoutlets.com/ coach factory outlet
http://www.coach-outletonline.us/ coach outlet online
http://www.michaelkorsoutletonlinestore.us/ michael kors outlet
http://www.michaelkorsoutletstoresco.com/ michael kors outlet

store
http://www.tiffanysjewelry-co.com/ tiffany and co jewelry
http://www.celineoutlet-online.com/ celine outlet
http://www.cheap-toms.net/ toms shoes
http://www.celine-handbags.com/ celine handbags
http://www.toms--shoes.us/ toms outlet
http://www.fitflopsandalssale.com/ fitflops
http://www.fitflopusaonline.com/ fitflop outlet
http://www.prada-handbag.com/ prada handbags
http://www.tiffanyandcoinc.com/ tiffany jewelry
http://www.prada-outlet.org/ prada outlet
http://www.michael-korsoutletinc.com/ michael kors
http://www.marcjacobs.us.com/ marc jacobs
http://www.supra.us.com/ supra shoes
http://www.ralphlauren.us.com/ polo ralph lauren
http://www.tiffanyjewelry.us.com/ tiffany jewelry
http://www.shoestoms.net/ toms shoes

__________

POLO says:

2014-08-04 07:39:00

http://www.superbagsmarket.com/ Super Bags Market
http://www.nike-jordanshoes.com/ Nike Jordan Shoes
http://www.thebeatsbydre.net/ Beats By Dre Outlet
http://www.michaelusakors.com/ Michael Kors Outlet Online
http://www.polo-tshirts.com/ Ralph Polo Outlet Online
http://www.northsclearance.com/ North Clearace Outlet
http://www.polo-ralphlaurenonline.com/ Ralph Polo Outlet
http://www.guccishoesuk-2014.net/ Gucci Shoes Outlet
http://www.michaelkorsstates.com/ Michael Kors Outlet
http://www.polooutlet-store.com/ Polo Outlet Store
http://www.ralph-laurenhome.com/ Ralph Lauren UK
http://www.marcjacobsonsale.com/ Marc Jacobs On Sale
http://www.mcmworldwides.com/ MCM Outlet
http://www.salongchamppairs.com/ Sac Longchamp Pairs
http://www.canada-gooser.com/ Canada Goose Outlet
http://www.burberrybags2014.com/ Burberry Outlet
http://www.michaelkors.so/ Michael Kors Outlet
http://www.oakley-sunglassfactory.com/ Oakley Sunglaases Factory
http://www.north-faceoutlet.us.com/ North Face Outlet Online
http://www.moncler-clearance.com/ Moncler Clearance
http://www.woolrich-clearance.com/ Woolrich Clearance
http://www.barbour-jacketsoutlet.com/ Barbour Jackets Outlet Online
http://www.moncler-jacketsoutletonline.com/ Moncler Jackets Outlet Online
http://www.monsterbeatsbydres.net/ Monster Beats Outlet
http://www.louis-vuittonblackfriday.com/ Louis Vuitton Outlet
http://www.lv-guccishoesfactory.com/ Louis Vuitton Factory
http://www.mcmoutlet-jp.com/ MCM 店铺
http://www.cheapdiscountoutlet.com/ Discount Clothes Sale
http://www.michael-korsfactoryonline.com/ Michael Kors Factory Online
http://www.coach-factoryoutlets.net/ Coach Factory Outlet
http://www.coach-blackfriday.net/ Coach Black Friday
http://www.coach-storeoutletonline.com/ Coach Store Outlet Online
http://www.coach-factoryoutletonlines.com/ Coach Factory Outlet Online
http://www.coachcoachoutlet.net/ Coach Outlet
http://www.coach-factory.net/ Coach Factory
http://www.coach-pursesoutlet.net/ Coach Purses Outlet Online
http://www.coach-outletonline.net/ Coach Outlet USA
http://www.mksfactoryoutlet.com/ Michael Kors Factory Outlet
http://www.zxcoachoutlet.com/ Coach Outlet Online USA
http://www.mischristmas.com/ Coach Factory Outlet Online
http://www.misblackfriday.com/ Black Friday
http://www.newoutletonlinemall.com/ Coach Purses Outlet Online
http://www.clickmichaelkors.com/ Michael Kors USA
http://www.cmichaelkorsoutlet.com/ Michael Kors Outlet USA
http://www.ralphlaurenepolo.com/ Ralph Lauren Polo

__________

POLO says:

2014-08-04 07:40:37

http://www.superbagsmarket.com/louis-vuitton-bags-c-1.html
http://www.superbagsmarket.com/hermes-bags-c-2.html
http://www.superbagsmarket.com/prada-bags-c-3.html
http://www.superbagsmarket.com/chanel-bags-c-4.html
http://www.superbagsmarket.com/gucci-bags-c-5.html
http://www.superbagsmarket.com/burberry-bags-c-6.html
http://www.superbagsmarket.com/celine-bags-c-7.html
http://www.superbagsmarket.com/balenciaga-bags-c-8.html
http://www.superbagsmarket.com/christian-dior-bags-c-9.html
http://www.superbagsmarket.com/chloe-bags-c-10.html
http://www.superbagsmarket.com/bvlgari-bags-c-11.html
http://www.superbagsmarket.com/bally-bags-c-12.html
http://www.superbagsmarket.com/coach-bags-c-13.html
http://www.superbagsmarket.com/michael-kors-bags-c-14.html
http://www.superbagsmarket.com/mcm-bags-c-15.html
http://www.superbagsmarket.com/fendi-bags-c-16.html
http://www.superbagsmarket.com/mulberry-bags-c-17.html
http://www.superbagsmarket.com/marc-jacobs-bags-c-18.html
http://www.superbagsmarket.com/miu-miu-bags-c-19.html
http://www.superbagsmarket.com/ysl-bags-c-20.html
http://www.superbagsmarket.com/tory-burch-bags-c-21.html
http://www.superbagsmarket.com/givenchy-bags-c-22.html
http://www.superbagsmarket.com/ferragamo-bags-c-23.html
http://www.superbagsmarket.com/lancel-bags-c-24.html
http://www.superbagsmarket.com/loewe-bags-c-25.html
http://www.superbagsmarket.com/tods-bags-c-26.html
http://www.superbagsmarket.com/paul-smith-bags-c-27.html
http://www.superbagsmarket.com/dg-bags-c-28.html
http://www.superbagsmarket.com/alexander-wang-bags-c-29.html
http://www.superbagsmarket.com/bottega-veneta-bags-c-30.html

__________

hollister clothing store (http://www.rayban--sunglass.com/) says:

2014-08-05 07:20:39

http://www.rayban--sunglass.com/ ray ban sunglasses
http://www.customscopyright.com/ coach factory outlet
http://www.hollisterclothing-store.com/ hollister clothing store
http://www.michael--korsoutletonline.com/ michael kors outlet online
http://www.oakley--sunglass.com/ oakley sunglasses cheap
http://www.saclancelfrance.com/ sac lancel
http://www.katespade--outlet.com/ kate spade outlet
http://www.katespadeoutlet-online.com/ kate spade outlet online
http://www.katespade-online.com/ kate spade online
http://www.coachoutlet-onlinestore.com/ coach factory outlet
http://www.abercrombie-andfitch.com/ abercrombie and fitch
http://www.michaelkors-outletsonline.com/ michael kors outlet
http://www.sacportefeuille.com/ sac portefeuille
http://www.oakley-sunglassesoutlet.com/ oakley sunglasses outlet
http://www.michael--korsoutlet.com/ michael kors outlet
http://www.toryburch-outlet-online.com/ tory burch outlet online
http://www.abercrombieandfitchstore.com/ abercrombie & fitch
http://www.fit-flops.co.uk/ fitflops
http://www.coachoutlet-onlinefactory.com/ coach outlet online
http://www.coachfactoryoutlet-bag.com/ coach factory outlet
http://www.tory-burchshoes.com/ tory burch shoes
http://www.coachfactoryoutletclearance.com/ coach factory outlet
http://www.raybansunglasses-cheap.com/ cheap ray ban sunglasses
http://www.valentino.us.com/ valentino
http://www.fitfloponline.co.uk/ fitflop uk
http://www.coach-outletonlinefactory.com/ coach outlet
http://www.coachoutlet-factorystore.com/ coach outlet store online
http://www.air--jordans.com/ air jordan
http://www.timberlandshoesus.com/ timberland shoes
http://www.michaelkors--handbags.com/ michael kors handbags
http://www.coachfactoryoutletnew.com/ coach factory outlet
http://www.coachfactory-onlineoutlet.com/ coach factory outlet
http://www.truereligionbrandjeans.us.com/ true religion outlet
http://www.truereligionjeans.us.com/ true religion jeans
http://www.coach--handbags.com/ coach outlet online
http://www.louisvuitton--outlet.us/ louis vuitton outlet
http://www.timberland--shoes.com/ timberland boots
http://www.isabelmarantshoes.us.com/ isabel marant shoes
http://www.coachoutletonline-factory.com/ coach outlet online
http://www.michael-korsonlineoutlet.com/ michael kors outlet online
http://www.louisvuitton-handbag.us/ louis vuitton handbags
http://www.coach-outletstoreonline.com/ coach outlet store online
http://www.true-religion-jeans.com/ true religion jeans
http://www.coach-outletfactoryonline.com/ coach factory outlet online
http://www.coachfactoryoutlet-official.com/ coach factory outlet
http://www.louis-vuittonoutlets.com/ louis vuitton outlet
http://www.officialcoachonlinefactorysale.com/ official coach factory outlet
http://www.coachoutlet-storefactory.com/ coach outlet online
http://www.michael-korsoutletsonline.com/ michael kors outlet
http://www.tiffanysjewelry-co.com/ tiffany and co jewelry
http://www.celineoutlet-online.com/ celine outlet
http://www.celine-handbags.com/ celine handbags
http://www.toms--shoes.us/ toms shoes
http://www.fitflopsandalssale.com/ fitflops
http://www.fitflopusaonline.com/ fitflop outlet
http://www.prada-handbag.com/ prada handbags
http://www.tiffanyandcoinc.com/ tiffany jewelry
http://www.prada-outlets.com/ prada outlet
http://www.michael-korsoutletinc.com/ michael kors
http://www.marcjacobs.us.com/ marc jacobs
http://www.supra.us.com/ supra shoes
http://www.ralphlaurenpolo-inc.com/ polo ralph lauren
http://www.tiffanyjewelry.us.com/ tiffany jewelry

__________

Gucci Outlet Sale (http://www.gucciclearanceoutlet.org/) says:

2014-08-14 07:42:53

Hard work never killed anybody. But why take the risk?

__________

mbt shoes (http://www.sellsmbtshoes.com) says:

2014-10-02 08:31:38

<p><a href="http://www.sellsmbtshoes.com"><strong>mbt shoes</strong></a></p>
<p><a href="http://www.sellsmbtshoes.com"><strong>cheap mbt shoes</strong></a></p>
<p><a href="http://www.sellsmbtshoes.com"><strong>discount mbt shoes</strong></a></p>
<p><a href="http://www.sellsmbtshoes.com"><strong>mbt shoes outlet</strong></a></p>
<p><a href="http://www.sellsmbtshoes.com"><strong>mbt shoes online</strong></a></p>
<p><a href="http://www.sellsmbtshoes.com"><strong>mbt shoes uk</strong></a></p>
<p><a href="http://www.sellsmbtshoes.com"><strong>mbt outlet</strong></a></p>
<p><a href="http://www.sellsmbtshoes.com"><strong>mbt uk</strong></a></p>
<p><a href="http://www.sellsmbtshoes.com"><strong>mbt shoes sale</strong></a></p>
<p><a href="http://www.sellsmbtshoes.com"><strong>wholesale mbt shoes</strong></a></p>


Add your comment on this article below:

Sorry, there's an error with your form entries. We really appreciate your comment, so please try again.

Form submitting now...

Name:

Website:

Email address (not displayed):

Enter your comment below: