Industry guru Dave Taylor answers free tech support questions about a wide variety of business and technical topics, including blogging, Google AdSense, MySpace, Sony PSP, Apple iPod, Mp3 players, management, Linux, SEO, Mac OS X, Facebook, Twitter, LinkedIn and Microsoft Windows.

How can I add a Google search box to my Web site?

Dave, I keep visiting sites and seeing these cool search boxes that let you either search their entire site or search the entire Google database, all without leaving that page! I want to have something like this and would appreciate your helping me figure out the code needed.

Dave's Answer:

This is a question that's going to result in some HTML listings. You know that, so there's no reason to panic!

First off, the good news. Google itself actually has a nice page offering you HTML code you can just cut and paste onto your own Web pages to produce the search box you seek, and some variants beside. Just check out Google Free.

Instead of relying on the bright sparks at Google, though, let's go through the steps of building our own search box instead, so you'll be able to see how it works.

Also, not to pick on Google because I think the world of those folk, but their HTML samples could be cleaned up a bit, usually, so I've also recast it as proper XHTML rather than somewhat sloppy HTML. Just don't tell Larry and Sergey, okay?

The basic technique involved here is to be able to manipulate one of the variables handed to the Google search engine, a variable called sitesearch. Set it to a null value and you're searching the entire World Wide Web, but set it to a specific domain and it's constrained exactly as if you had typed in the Google special notation site:domain.

In addition to that, you need an input field and a submit button. Put them all together and here's the minimalist Google search form that lets the user alternate between just your site (well, in this case just my site) or the entire Web:

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

<input type="text"   name="q" size="31"
 maxlength="255" value="" />
<input type="submit" value="Google Search" />
<input type="radio"  name="sitesearch" value="" />
 The Web
<input type="radio"  name="sitesearch"
 value="askdavetaylor.com" checked /> Ask Dave Taylor<br />

</form>
There are some additional tweaks we can apply to make it a bit more fancy, including changing the radio buttons to a single check box, and aligning things a bit more nicely using a table and some simple CSS:
<form method="get" action="http://www.google.com/search">

<div style="border:1px solid black;padding:4px;width:20em;">
<table border="0" cellpadding="0">
<tr><td>
<input type="text"   name="q" size="25"
 maxlength="255" value="" />
<input type="submit" value="Google Search" /></td></tr>
<tr><td align="center" style="font-size:75%">
<input type="checkbox"  name="sitesearch"
 value="askdavetaylor.com" checked /> only search Ask Dave Taylor<br />
</td></tr></table>
</div>

</form>
Here's how that renders when included on an HTML page:

only search Ask Dave Taylor
If you'd like to use this on your own site, simply change the occurrences of askdavetaylor.com as appropriate.

Not too hard at all!



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

I tried this and when I try to enter a search term it sends me to the google page. Any thoughts on what I may be doing wrong or not doing.
Thanks

Posted by: PJ at December 10, 2004 10:12 PM

If it's working properly, the search box should send you to the Google site, but with the word or words you typed in prefilled in as the search terms. Is this not what you're seeing? If so, what are you seeing? Also, what happens when you type in a term on the search box at the end of my article? Does that work for you?

Posted by: Dave Taylor at December 11, 2004 4:23 AM

Is there a way to have the results pop-up in a new window?

Posted by: John Kiester at December 11, 2004 4:51 PM

John, you'll laugh when you find out how easy that is! The line

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

just needs to have target="new" added and it'll redirect the result of that form to a new window called "new". If you always want to guarantee that a new window is launched rather than possibly reusing the 'new' window, use "_blank" as the target instead:

<form method="get" action="http://www.google.com/search" target="_blank">

Hope that helps!

Posted by: Dave Taylor at December 11, 2004 5:07 PM

I looked at my coding several times last night and missed a typo. Things are working just fine now. Thanks for your help.

Posted by: PJ at December 11, 2004 5:10 PM

OK...I must be missing something here. How does this code search MY site? For example, if I have the word "pumpkin" on a page in my site will this search return a URL to that page?

Posted by: David at December 13, 2004 1:39 AM

Thanks for your note, David. Checking on "search my site" in the form causes the search to automatically include "site:yourdomain" so that it only searches pages in the Google database that have your domain as the base of the URL. In essence, it's a search engine for your site alone. Matches then go back to your site. Hope that clears things up!

Posted by: Dave Taylor at December 13, 2004 1:51 AM

Dave, now I understand what it is supposed to do. I thought it was going to search in MY domain...within my site...for the text entered...my bad. Thanks for setting me straight. David.

Posted by: David at December 13, 2004 10:31 PM

I would like a search box to find things within my site only. my site is not ready yet to submit to any of the search engines as i dont want to get black listed for broken links etc. How can I make and test a search box for my site without submitting to Google etc.

Cheers

Posted by: adam at January 20, 2005 8:49 AM

You can't use the Google search tool to find content on your site if you don't want Google to see it, Adam, so you'll need to install a search engine of your own on your server. If that's a possibility, then I'd talk with your Web hosting provider because they might already have something installed. Good luck!

Posted by: Dave Taylor at January 21, 2005 2:41 PM

Thank you for this tip! How kind of you to do all this work so I can have it so easy. THANK YOU THANK YOU THANK YOU!

Posted by: Donna at June 3, 2005 4:14 AM

I'm making my site and have kept the google search in it. It's too easy to put google search and in few seconds it worked fine.

Thanks alot for the code that is mentioned here.

I've added my site to google and would like to know more about how I can get my site on the index page of google.

Regards,
Piyush

Posted by: Piyush at June 26, 2005 4:26 AM

Dave,I have added Google to my webpage using the "Google free" code. Can you please tell me how can i by default place the cursor in google search box?

Posted by: Vikesh Jain at July 29, 2005 12:15 PM

It is my understanding that you can get paid by Google when people use your site's Google search box. How does that work? Do the ads have to be able to pop up on your site or can the inquiries be sent to the Google website, leaving our website free of clutter? How do you set it up so that we get paid when people use our search box? I have tried to find the answer in Google's help pages but I just can't seem to get a solid answer anywhere.

We are also trying to customize the appearance of our Google search box so that it fits within a certain space designated on our website. Any recommendations?

I am at my wits end and desperate for help!

Posted by: Tracy at August 5, 2005 8:51 PM

I'm trying to add the Google search to my blog, but it doesn't seem to work. Perhaps I'm inserting it in the wrong location. Perhaps I need different code because it's a blog, not a web site. Any help would be appreciated. The blog's purpose is to facilitate communication among former high school classmates, many of whom do not seem to be very Internet savvy. I'm hoping a "search this site" function will help them to locate names more easily

Posted by: Nadine at August 18, 2005 11:07 PM

how can i make a search "form" such as one that a car dealer would use to have people search his site for a car. one that would use multiple boxes such as "make", "model", "color" etc. and use all the boxes to come up with results

Posted by: manny at August 19, 2005 8:45 AM

Hi Dave, I entered the code like said and changed the domain, but the search won't work on my site. (as in, won't return a search relevant to my site), but will do the google search just fine (when i uncheck the box). any thoughts on how i can fix this? thanks!

Posted by: Jillian at August 27, 2005 5:58 AM

Two issues, Jillian. First off, you need to not send the "http://" part in your 'sitesearch' field, but more importantly, a search of Google shows that it doesn't have a single page of your site in its search engine, so there's no way for it to ever succeed. Try searching for 'site:www.askdavetaylor.com', for example, then search for 'site;vespa-rosso.blogspot.com' and you'll see what I mean. Sorry!

Posted by: Dave Taylor at August 27, 2005 6:37 AM

Dave, I'll fix the first part (the http), but I also noticed the google search thing. How can I change this? I listed my site with google about a week or two ago. Thanks!
Jillian

Posted by: Jillian at August 27, 2005 4:59 PM

You might just need to have some patience, Jillian. Google has a "sandbox" where brand new sites and domains are parked for a few weeks up to a few months before they're added to the full Google database. That's so spam sites don't just pop up and corrupt / pollute the Google database, but it's darn frustrating for us legitimate content providers. Sorry!

Posted by: Dave Taylor at August 28, 2005 4:11 AM

Hi Dave, I've read all your comments to other posts and I'm using CityMax for my host and they don't offer a search box for my site. I'd love to have one that just searches my site and no advertisements.. google seems to have a problem with my site since it's through a host and not mine... :(Can you help me with how to add a search box to my site that only returns items from my site with pictures? Like any one of the pages listed below would be fantastic.
www.silady.net (www.silady.net/page/page/2265521.htm(home page)), (www.silady.net/bracelets.html),
(www.silady.net/earrings.html), (www.silady.net/necklaces.html),
(www.silady.net/pendants.html), (www.silady.net/rings.html), (www.silady.net/sets.html), (www.silady.net/page/page/2319361.htm)

Thanks and praying really hard for help :) Deborah

Posted by: Deborah Skipper at September 3, 2005 9:38 PM

Hi Dave,

I ve got the google search on one of my sites and it works great for searhced throughout that site.
However I would like to have the search box search sites "a" "b" & "c" all at the same. So far i can only get it to either serach teh whole web or just the one site. Ive tried checking all teh radio buttons, but this just makes its search teh last one.

any ideas?

Posted by: chris at October 11, 2005 8:41 PM

i have a set of pages to be listed and another set which should not be listed.. how do i do this?

Posted by: Balaji at October 12, 2005 11:57 AM

Balaji, you'll want to learn more about the robots.txt file, and specifically the equivalent meta tag you can add to specific pages that tell search engines not to include those pages in indices. See: http://www.askdavetaylor.com/about_robots.html

Posted by: Dave Taylor at October 12, 2005 6:36 PM

Hi Dave, I was reading your article about the Google Search Box. I have a website running in PHP-Nuke. The code does not seem to work. I tried adding it to a block, and all that appears is just the *.gif from Google. Can you help?

Posted by: DJ Ortiz at October 16, 2005 5:57 PM

Ok I see that you have ads by google on the top..well I signed up for google ad sense..and when I copied and pasted the html code to a site..the ad on there was for another site. Isn't it supposed to show my site ad? Could you help me out on how to advertize my site?

Posted by: Youx at November 2, 2005 2:01 AM

Youx, I don't really understand what your expectations of AdSense are: you don't want ads for your own site on AdSense, because then you'd be paying for click-thrus that are from people already at your site. Make sense?

Posted by: Dave Taylor at November 2, 2005 4:05 AM

I got a search box coding from your site. Thanks a lot for it.
I am doing a search engine website. When i do this site i may get lots of problems, i think i can get solutions from your site.

Thanks a lot.

Posted by: Vidya at November 20, 2005 10:51 PM

I was wondering if there is any way to add a 'Local' search box to my web site. I would like to have a link to search local restaurants, stores, etc... Is there any weay to do this?

Thanks!

Posted by: Danny at November 29, 2005 6:54 PM

I was wondering if you can stop the google search from looking in certail folders/directories?
Also can you customize the look of the search page?

Thanks for all the help?

Posted by: cw at December 5, 2005 10:19 PM

Thank you for all you do for us.
Is there a way to stop the google search from searching certain directories on your website?

Posted by: cw at December 6, 2005 2:32 PM

Yes, check out the robots.txt information on the Google site:

http://www.google.com/webmasters/bot.html

I think that'll show you how to exclude certain directories.

Posted by: Dave Taylor at December 7, 2005 7:28 AM

can i include in my site to search web sites from my site or i need to pay any thing? it is opening search result in the same web brouser cant we open in the new web brouser?

Posted by: Sajja Rjaes at December 26, 2005 11:36 PM

Sajja, you're welcome to use this code for free - thanks for asking - and if you want to have it open in a new browser, add

target="_blank"

to the "form" tag.

Posted by: Dave Taylor at December 27, 2005 11:09 AM

I put a google free site search on my webpage and there is another one below that with search the web and my website. I look in the HTML code but there isn't any for the bottom one. I only copied the HTML for the top one. How do I remove the bottom one?

Posted by: Peder at January 7, 2006 4:33 PM

Peder, assuming you haven't copied and pasted it twice, I can't imagine how the code I present here could produce two search boxes for you. Can you email me your page URL (use the "Ask" button near the top) and I'll have a quick peek?

Posted by: Dave Taylor at January 8, 2006 12:02 PM

How do I add in the option of searching either the Web or only pages from the UK

Posted by: John at January 19, 2006 10:37 AM

John, just tweak the code I show to have the option of adding site:uk as a way to constrain your search results.

Posted by: Dave Taylor at January 19, 2006 10:44 AM

thanks for the quick reply. Not knowing how to do HMTL code you couldnt give me a clue how to restrict the search.

John

Posted by: John at January 19, 2006 1:03 PM

Dear Dave,
I was wondering, could a form like this work when trying to search images and web on google as two seperate actions in one form.

Posted by: Ian at January 20, 2006 3:29 PM

is there any way to have the results of the search display in my own page rather than googles? if not, do you know of a search engine that can be bought that has functions to prioritize search results? let me add my thanks to the bunch. thanks.

george

Posted by: george at January 24, 2006 3:51 PM

A couple of questions:
I know the first one has been asked a couple of times here but I haven't seen an answer yet. Can you get the google results to come up on your own page, instead of transferring to the google website?

And is there any way of tracking what people are searching for, when they use the search box on your site? Any ideas of how you can do this?

Posted by: Trudes at February 8, 2006 12:36 PM

George, Trudes, no, you can't do that without some sneaky hacking behind the scenes that Google won't look upon happily. In terms of what they're searching for, yes, you could theoretically create a search box that feeds the search query to an intermediate script that logs their search pattern then bounces them directly to Google. Hmmm.... :-)

Posted by: Dave Taylor at February 8, 2006 2:45 PM

Ok, now you've lost me. How would I set up an intermediate script? I'm still learning!

Posted by: Trudes at February 9, 2006 5:26 PM

how can i add vote button to my website.

Posted by: mohamed at February 11, 2006 5:01 AM

When you use google as a search engine on your own site, I think you still need to display the Google graphic. (See Section 2.3 Attribution at http://www.google.com/services/terms_free.html ). Please correct me if I'm wrong.

Posted by: Anjanette at February 17, 2006 5:34 PM

I've been looking for some proper valid code for these pesky search boxes all day. At last I've found it! Thanks Dave! And (if it isn't too late) Happy New Year :)

Posted by: Chris at March 2, 2006 8:23 AM

Hello, recently I decided to add a search feature to a site I'm constructing, http://skee.zaiph.net
However, the Google search bar doesn't work! If I attempt to search for any keywords whatsoever while on the "Search this site" option, no results appear.
The site uses an iFrame, is there a chance that this may have effected the searches?
Also, when I was on the panel that enables me to control the search bar (I am using the free one that enables the site's banner to display on the results pages), it states only 1 page is registered for my site.
How can I add more of my site's pages to the Google database? Why isn't the search bar working?

Thanks in advance! Also, if this helps any, the link to the Google searchbar is at
http://skee.zaiph.net/other/googlesearchtest.html

~James

Posted by: James at March 12, 2006 9:16 PM

James, the reason that Google isn't finding your search results is because your site is just too new. Your best bet for getting into the Google database is simply to have sites point to you and make sure that each of your pages points to all your other pages. Then just have some patience!

Posted by: Dave Taylor at March 12, 2006 10:18 PM

Hello Dave,
If you visit my page, you can see that I need major help with my page. First, I want my side bar to align right next to the posts. Second, the google search does not work with my site. I know that there are only 2 comments, but when I type "Dr. Hyde in the Wordpress search, it comes up with the comment that has Dr. Hyde in it, whereas the google search for my site does not..... PLEASE HELP.. i am not familiar with CSS, but if you canhelp, it would be great
Thank You
Deepa

Posted by: Deepa at March 21, 2006 12:21 PM

Dear Dave,
I posted my question a couple of days ago and I don't know when to expect a response from you. I don't know how these forums work either. I just wanted to let you know that I am in deperate need of help. Please, anyone, can you help me?

Posted by: Deepa at March 23, 2006 5:05 AM

Excellent information!

I'm using the Google search (not for my site, just to do full web searches from my site). How can I get the cursor to default to the Google input box?

I'm glad to send you a link to my site, but didn't want to post it as it's under construction, and currently lacking in some areas of security.

Thanks for any help or suggestions!

-Steve

Posted by: Steve at March 24, 2006 6:27 PM

I would like to have the Google search box search several different sites (call them "a" "b" & "c") all at the same. So far I can only get it to either search the whole web or just one site. I can do this with Yahoo but can't figure out how to do it with the Google code.

any ideas?

Posted by: Cecilia at March 25, 2006 9:21 AM

Steve, that's a basic JavaScript trick: make sure that the input field has an explicit name (which it should anyway, let's call it "fieldname" for this explanation) and that the form itself has a name (add a name="formname" attribute within the FORM tag itself), then in the BODY tag add the following attribute:

onLoad="'document.formname.fieldname.focus();"

that should be all you need to do!

Posted by: Dave Taylor at March 27, 2006 8:54 AM

Hi, How would be the same search box using froogle?
Thanks in advance

Posted by: javier velasquez at April 1, 2006 8:51 PM

Your code and this page are not XHTML valid. I believe the checked value is the problem.

Posted by: Castor at April 15, 2006 4:41 PM

First, many thanks for the great information! Can you please explain how to use the site: variable to search several different sites at the same time? I would like to have a search box on my intranet that searches a handful of sites, but I don’t want to offer each site as a choice, I just want a box and the Google search button, and have it search all of the sites.

Thanks in advance for your help.

Posted by: Rob at April 18, 2006 3:00 PM

Dave, how can you change the attributes of the Submit button (font, color, color of the button, etc.)? When I get the answer, I promise to buy you that chai.

Posted by: Mae at May 4, 2006 6:38 PM

Mae, good incentive! Here's what I wrote up:

http://www.askdavetaylor.com/how_do_i_change_the_appearance_of_a_submit_button.html

:-)

Posted by: Dave Taylor at May 5, 2006 11:48 AM

Thanks Dave! You're the best. It's hard for my readers to search my old blog postings but you've just made it easy and nice to look at!

Posted by: Fashion Victim at May 7, 2006 5:52 AM

I would like to have the google search and google adsence to my website can you guide me how to do it.

If i copy-paste the the code you mention above where will the box be placed on my webpage , will it not change all the existing setting.

Posted by: Mukul at May 14, 2006 4:24 AM

To get started with AdSense, Mukul, please check out the following quite popular reference page:

http://www.askdavetaylor.com/how_do_i_get_started_making_money_with_google_adsense.html

Hope that helps you out!

Posted by: Dave Taylor at May 15, 2006 10:08 PM

Using the "google search" seems reltively easy as you explained! It seems the only search I get is from my index (home) page? What is the proper code to search all pages? I'm the novice here when it comes to html and my site is as "green" as can get for expertise! Thanks so much and I do enjoy all the reading! You're very knowledgable and appreciated!

Jeff

Posted by: Jeff at May 20, 2006 8:46 AM

please give some idea to develop a searc engine.
Or give me some method how to implement google search so that my company logo will come after search,means i dont want to allow google logo

Posted by: sangram at May 22, 2006 8:32 AM

Thanks a lot for the code, but I couldn't get it to search an internal database on an internal network (my code for database search was as value="K:\InternalDatabase\" (drive and file names changed for security reasons, yet the format is exactly how I have it)). Do you know if I can make the database searchable with Google Search?

Posted by: Vitali at June 14, 2006 8:16 AM

I would love a search box for my site however, I don't like the way it is boxed with a black line.
Is it possible not to have it outlined?

Posted by: Miriam at June 18, 2006 6:39 PM

Miriam, that's easy. Just take out the

border:1px solid black;

from the code snippet (it's in the "div" tag) making sure not to remove the quote just before it, and you'll have the box and search function without the black box line!

Posted by: Dave Taylor at June 19, 2006 9:51 AM

I was wondering, I want to put this google bar in my banner on my page, but I am building it in Fireworks and there is no code view, can I do this? I also will be using either Dreamweaver or FrontPage, could I put it in my banner using one of these programs? I would use the banner as a background image except I have my buttons on it so I am going to have to import it as multiple Fireworks files. Help would be great! Thanks!

Posted by: Matt at June 28, 2006 10:48 AM

I added the Google site search to my site last year. But it does not find new content.

For example, I added the terms "yankee doodle dandy" to a test page back on 9/9/2005. However, upon a "site" search, it does not locate the page with that term.

Can I assume that my site must be re-indexed by Google before any new content will be found?

thanks in advance

Posted by: nick at July 6, 2006 9:59 AM

I've trie to put google search on my site in the top border (front page) so it will appear on each page, but I cut and pasted it, couldn't find the html for the border. Help......Nice site!!!

Posted by: Bill Randle at July 14, 2006 2:08 PM

hi dude....i ur site is very useful for me....here i come up eiyh one question...

i need to add my website in google search...
i looked some articles related to google search optimization...but iam clear ...so can u help ?

i need the simple steps in designing , implemetation & i also want to know about aother pay search engines...

it will be very help full for me if u do this
thanks
vish

Posted by: Vish at July 17, 2006 1:53 AM

Hi Dave - This should be easy for you, but I'll still buy you a Chai if you can help... I just put an Adsense search box on my front page, but I'd really like the button to default checked on MY site. What do I have to modify in the code? Thank you so much.

Posted by: Steve at August 8, 2006 10:55 AM

...And while I'm asking, I just noticed that on my OS X system, When I used the search box with "web" clicked, it turns up nothing in the search! But it's just fine on my older system. What am I doing wrong...? Thanks again.

Posted by: Steve at August 8, 2006 12:02 PM

Steve, the AdSense search box is a different beast. Let me dig around and see what I can put together.

Posted by: Dave Taylor at August 8, 2006 3:34 PM

I'm grateful for websites like this, and I'm very thankful for people like you, dave. Thank you very much. But I'm wondering if, for example, somebody did a search for my website and did not find it, but my other website can be found, how can I add the new website to appear in the search?

Posted by: nephi at August 22, 2006 2:58 AM

Dave, I can't get either of your above sets of search code to work. What could I be doing wrong. Thanks , Jerry

Posted by: Jerry Mersch at September 1, 2006 5:34 PM

I can't get Google Search box to work on my intranet site. Can it work on an intranet site?

Posted by: Terri at September 15, 2006 7:03 AM

hello dave,actually i am kind of new to adsense and web designing.I have a blog at http://technogeekzz.blogspot.com/ at blogger.com.Now
I want to enter the google searchbar and some other banners on my site related to google software.I have the html codes(thanks to you for the google searchbar )but i dont know where to put this actually.There is an option in the templates section at blogger.com where i can view and edit the whole html code of my site but i dont know exactly where to put these banners and searchbars.Any help would be greatly appreciated.please reply here or if u can plz mail me at kartiksatija@gmail.com it would be really great...thanx in advance...awaitinf for ur reply

Posted by: Kartik at September 25, 2006 3:37 PM

I am truly amazed by this site! Why are you doing this? WHEN are you doing this? - Anyway, I very much like the 'additional tweaks' version of the script on top of this page. Can you also do it the other way round? I mean, what is the code to create a decent search box and submit button just to search your own site and a little check box underneath if you want to search all of Google?

Thanks.
Jeroen (pronounced as 'yaroon'), Belgium

Posted by: Jeroen Messely at September 29, 2006 7:41 AM

You can most definitely tweak things. Have a look at how I integrated the AdSense for Search system into my Intuitive Life blog, actually:

http://www.intuitive.com/blog/

(it's on the right nav bar, about half-way down the page)

Then read this to see how it was done:

http://www.askdavetaylor.com/how_can_i_get_google_search_results_on_my_site.html

Posted by: Dave Taylor at September 29, 2006 10:21 AM

lol hey dave

killer script

thanks

Jason
ZTEK

Posted by: jason at October 4, 2006 2:09 AM

I added your google search tags to my webpage, which didn't pass XHTML validation. To be sure, I pasted your tags on an empty page, but it still earned one error as below. Please help!

+++++++++++++
the name and VI delimiter can be omitted from an attribute specification only if SHORTTAG YES is specified.

value="askdavetaylor.com" checked /> only search Ask Dave Taylor

"VI delimiter" is a technical term for the equal sign. This error message means that the name of an attribute and the equal sign cannot be omitted when specifying an attribute. A common cause for this error message is the use of "Attribute Minimization" in document types where it is not allowed, in XHTML for instance.

How to fix: For attributes such as compact, checked or selected, do not write e.g <option selected ... but rather <option selected="selected" ...

Posted by: Yoki at October 7, 2006 10:54 AM

Easily fixed to be fully XHTML compliant:

value="askdavetaylor.com" checked="checked" />

that's all there is to it.

Posted by: Dave Taylor at October 7, 2006 12:46 PM

Hi Dave,
I'm been trying to find the right code to copy google's search bar with all of it's features, like images, videos, maps, etc. So far i've only been able to edit the script where the normal search works, but the images and other things don't work. Do you have a code or know where to get it?

Thanks,

Mike

Posted by: Mike at October 7, 2006 5:23 PM

Hello Dave, Thank you for answering my earlier question. Your answer helped me understand the validation error message!

Posted by: Yoki at October 13, 2006 2:19 PM

Hi Dave - I'm using frontpage to design my site and am having some problems with the search box. I copied the code you gave me onto my site and it doesn't seem to return any results. I understand that it won't return anything results from my site yet since I just registered with Google, but shouldn't it return results for searches outside of my site? Right now, when I click the button, nothing happens.

Help - and thanks for all the good advice.

Posted by: Keith at October 29, 2006 6:21 PM

Nice article, i have a simple question, is it legal to edit the google search form ,remove the google image and radio? i would like to do that on my site www.BadrIT.com.

Posted by: Mohamed Hassan at November 6, 2006 10:41 AM

Mohamed, I guess it depends on how you define "legal". There's no *law* saying you can't do that, and I really can't imagine that Google is going to notice or really care if you tweak with the script if you're sending them traffic. However, I do recall that the terms of service for searches indicates you shouldn't be monkeying with the script.

Posted by: Dave Taylor at November 6, 2006 3:35 PM

Thanks for your reply, i reviewed the terms of service but the only restriction i could found is that i must put google logo, can you tell me please where is the part that say not to play with the scripts, i am feeling that i may missed some thing!


Thanks.
Muhammad Hassan

Posted by: Muhammad Hassan at November 13, 2006 9:36 AM

First thanks for all the helpful information. I imported the code and when I search "my" site, for a word, for example, Necklaces, it returns results from my shopping cart software, but not from my site proper. When do a Google site search for www.maggies107.com, I get the first page of my site, and the shopping cart data. What do I need to do to get the balance of my website to show up? Would including the sitemap for the Google information cure this?

Thanks for the info. Appreciate the service, as I am in the boonies with no other brains to pick.

Posted by: Margaret at November 17, 2006 2:18 PM

This page requires Unicode support of your browser. You need "Arial Unicode MS" font to properly access this page. If you see any junk characters, square boxes or question mark, it shows that you do not have unicode font installed on your machine. Microsoft Office 2000 or higher version comes with this font. You can install this font from the Office CD. You may try to download particular language font from
If you think that font is already installed, try these steps.
1) Go to View Menu > Character Encoding.
2) Change the encoding to Unicode(UTF-8).
3) Refresh/Reload the page by pressing F5.

Posted by: u at November 28, 2006 1:09 AM

Thanks for the code. Great help!!!

Posted by: George Elliott at December 8, 2006 3:18 AM

Hi Dave! Wicked awesome plugin. But, I do have a query.

First: It works. No sweat.
Second: Whenever I add the code checked="checked" somehow after I submit the changes, it wipes that particular string out. nothing else, just that. Like it's invalid & trying to get rid of it. Any clue why? I can't get the code to make the box checked.
Alternately, I'd be happy with no check box, so it ONLY searched my site. I couldn't finagle the code to do that though. Any clue?
Thanks!

Posted by: Viscouse at January 9, 2007 7:42 AM

Dave,
Can I modify my "custom google search box" to just search a few specific sites, not just one?
Roger

Posted by: Roger at January 12, 2007 3:19 PM

Thanks for the code to add google search box in my blog. But i have a problem integrating wikipedia search within the same script.. i tried making another button for wikipedia but with no success with the search results. Since i am not that familiar with HTML, i couldn make it work. Is there any way u can make it work?
Thank you.

Posted by: Girish at January 13, 2007 11:32 AM

Dear Mr.Dave,

When I add your code into my blogger:


only search Ask Dave Taylor


It appear the following warning:

"Please correct the error below, and submit your template again.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: Attribute name "checked" associated with an element type "input" must be followed by the ' = ' character. "

Please help me to solve this problem.

Thanks you so much.

Thi.

Posted by: Thi-AIT at January 26, 2007 12:56 AM

My server has a pre-coded search query box that searches just my site and does what I need for the most part. I am satisified with that aspect, yet is there a code I can insert within their code that will HIGHLIGHT the search result? I have an example for test search box on the url:

http://www.puddleofmuddfanpage.com/upchurch.htm

A search of 'Chicago' yields 13 results, but I have a lot of text on the site and I feel the users will get frustrated trying to find their keyword without a highlight tag.

Or another option, is there a code that will make it jump to the first result within the website, then a next button, similar to the search option for a keyword in Microsoft Word Document that will make it jump right to the next result?

FrontPage has an insert search box option, but I have a code conflict with my server and I'd rather just use the servers code and I insert their code manually. My site is new and hasn't been listing on Google yet so the Google search box isn't an option yet.

Thanks for all your assistance to others, I have been reading a lot of your site today.

Posted by: Karen at January 30, 2007 10:10 AM

It was really fruitful and it was up to my needs it also proved to be inspiration for me i tried and found out Google Custom Search Engine

Ultimately very happy....

Posted by: Chaitanya Parekh at February 12, 2007 6:55 AM

Thanks Chaitanya Parekh ! With a little work I finally got it to search all of my pages and not just the front page. Also for the ease of use for my visitors, I just added a message above the search box to view in 'cached' for their keywords to be highlighted since I have a lot of text on my pages. I appreciate your suggestion for to Google Custom Search Engine option. Up and running perfectly, thanks again.

Posted by: Karen at February 12, 2007 4:04 PM

How do you make a "Submit" button automatically pop up?

Posted by: Eric at February 21, 2007 11:43 AM

Hi I just wanted to say thanks for the code, I am currently having a problem getting the code to search my whole site though, here is my form,


It seems that it only wishes to search my index.html page and not search through all of my .html pages.

If you could get back to me that would be most appreciated.

Wayne

Posted by: wayne at February 23, 2007 1:16 PM

Wayne, that is the problem I had in the beginning, trying to get it to searc all of my pages. With more reading into the how to section, I found I had to add under the control panel/sites, some wildcard entries to have it hit all of my pages.

Fill in your site name and add each URL:

*.puddleofmuddfanpage.*
http://www.puddleofmuddfanpage.com/*
http://www.puddleofmuddfanpage.com/public_html

I have those 3 listed and it searches all of my pages. So it appears you should have a minimum of those 3 versions. It works with no problems, I added it to my front page in the left column if you want to take a look. Also if you type in a keyword, such as Chicago, if you view it in cached option, it highlights it to make finding the keyword easier. I have a lot of text on my pages, so I added those directions above the search box so users would be able to find what they are looking for easily. Hope this helps!

www.puddleofmuddfanpage.com


Posted by: Karen at February 26, 2007 10:53 AM

Wayne, is it possible that your site simply isn't fully indexed by Google? Try doing a search like site:askdavetaylor.com (with your domain name rather than mine) and see how many pages match. That's an easy way to see what's in the index...

Posted by: Dave Taylor at February 27, 2007 9:19 AM

Hi Mr.Dave thanks a lot for the great codes.
It works fine on my site.but i dont understand why it still return the old contents.
But im not deleted yet the old file in my domain.
I just replace with the new contents and interfaces.
How can i solved this problem..thanks in advance

Posted by: wani at February 28, 2007 2:04 AM

what does script error 95 mean plz help it keeps coming up on mii piczo site i wanna no how to deletye it cause i can not edit anything plz help ..... thankz for the help .... xx dana

Posted by: dana toppinen at February 28, 2007 6:36 PM

re: Kontera and multiple web pages

If a person has a website with many many pages, what is the easiest method or manner to insert Kontera code on to each of those webpages?

Thanks...

Colleen

Posted by: Colleen at March 3, 2007 5:45 PM

Colleen, I hope that you have some sort of template or other system built around a content management system (a blog, something like Article Manager, whatever) so that you can apply changes quickly? Failing that, some server-side includes (SSI) that lets you change one file and deliver up the changes to all of your pages? Otherwise, well, you have a tedious task ahead of you..

Posted by: Dave Taylor at March 3, 2007 8:45 PM

Hi Dave I would like to add google search to my companies intranet homepage to search the internet, do you know how to do this using xml? Our intranet home page was built using flex2.

Posted by: jon at March 6, 2007 7:54 AM

Thanks works a treat

Posted by: Damian at March 6, 2007 9:19 AM

Hi Dave,

This code is great, thanks. One question though: Is it possible to have only the text input field and submit button and it still search only our website, not the world wide web? I have no use for the radio buttons or the check box..

Posted by: Cain at March 7, 2007 11:36 PM

Nevermind! I used a hidden input type with our site address as the value and the "sitesearch" as the name and it works fine. :D

Posted by: Cain at March 8, 2007 12:26 AM

Hi,Dave.
We are one of the manpower agency and we would like to install Google search
engine in our website (www.jobonhand.com)to search suitable resume for our
employer view.I found that one of the web site installed the google
search engine on their site,
(www.amrood.com) please help me to avail the
facility.

Note: The google have sent me the key code, even though,i cant search what i want exactly.

Posted by: Ramesh Kumar at March 8, 2007 6:54 AM

I have a major problem i add google search box in my site but it only search for few static page of my site not for whole site .please tell why it is happening

Posted by: naveed at March 8, 2007 1:38 PM

Thanks Dave. I'm using your code on my site and it works great.

Posted by: Dave at March 8, 2007 7:57 PM

Dave,
How do you put a search box on a web page that will search ONLY that page?
Thanks in advance!

Posted by: Todd at March 14, 2007 9:20 AM

dave, there are some of the strange google search box, like there is a backround int he search box, how can we do that ? l mean a backround image in search box and a default text "search in google" or some special features, can u teach us pls ?

Posted by: recep at March 22, 2007 4:30 PM

Dave, I was just wondering how do I take out the ads from google search? it's working fine but I don't want to have ads displayed on the University developed web site. any suggesions? comments?

Thanks in advance,

Regards,
Atiq Warraich
warraich@ur.msu.edu

Posted by: Atiq Warraich at March 29, 2007 11:33 AM

Dave,
Very much appreciate the code. I narrowed the box and input field and dropped the border and it looks like it just grew there :-)

Now if I could just find some people who want to buy wooden pens, bowls or keychains ...

Oh well, Adsense won't pay the mortgage on my house yet, but it's almost to the point of paying for the website rent. Progress ... not perfection.

Posted by: BillinDetroit at April 6, 2007 10:41 PM

Hi i have the box on my web page but you can not search in in what do i do here?

Posted by: Tom at April 11, 2007 4:41 AM

Hie

I have a search option. In which there is a textfield and Submit Button. Before i press the button, i have two Radio Buttons.
1: Site Search
2: Google Search.

I want to have a check that when 2nd radio button is pressed it should go to google for search. Otherwise it should search within the website.

Can you help me implimetning these two?

Help much appriciated.
Many Thanks
Tauseef

Posted by: Tauseef at April 16, 2007 5:55 AM

This web site is to search for words within the web site, so I would like to use my own search button like I've seen everywhere on other sites. I have seen the Google Search that gives you two options, to search thru Google or thru the web site itself, but when you chose to search thru the web site Google jumps in and the words you selected are listed with your web site link at an outside Google listing. I would like for people to type a word inside the search box and to jump straight to where that first word is and so forth. Is there an easy way to achieve this?

I'm not technical at all and time is of the essence to get this set up for our members and everyone out there. We conduct paranormal research and educate the community in the paranormal field.

I can even go as far as letting someone design my search button with that purpose and give him/her credit on the web site... This is an extension of a non-profit organization, Paranormal Awareness Society, Corp. and we need help.

Please help me.

Lourdes Metz

Posted by: Lourdes Metz at April 20, 2007 8:40 PM

Thanks !!! its work !!!!!!

Posted by: sami at April 21, 2007 9:44 PM

hi every body

Posted by: nijyar at April 25, 2007 6:19 AM

Thank goodness I found this answer I had done all sorts of searches and could not find code I wanted. Now the hard part. The code works fine. But is there a way to get the terms that people searched for from this form. That way I can learn better what they are looking for and tweak the content. This would be great! I am running on windows server and did not know if have to have database set up or could just get e-mail?

Posted by: David Cox at April 25, 2007 2:57 PM

If you had access to your server, you could write a rudimentary CGI script that simply logged the search string and then bounced it to Google. That's probably a three line shell script in Linux, for example:

#!/bin/sh
logfile="yourdirectory/search.log"
echo $QUERY_STRING >> $logfile
echo "Location: http://www.google.com/search?$QUERY_STRING"
echo ""

exit 0

[caveat: not tested!]

Posted by: Dave Taylor at April 25, 2007 3:40 PM

I set up an Access database on my site, but not sure how to get form to also place info into it. I am using dsn

Posted by: David Cox at April 25, 2007 7:02 PM

Just dropping by to say thanks for the great and thorough information, as usual. You are obviously a very dedicated and hardworking individual.

Posted by: Internet Marketing Tools at April 30, 2007 2:02 PM

Thanks Dave I will try this but I am not linux aware.

Posted by: David Cox at May 1, 2007 4:55 AM

ku soo dhawoow website ka maxamuud,
boga heesaha
waxkabaro diintaada
khatarta intarnetka

Posted by: mahamoud at May 1, 2007 6:30 AM

does this google search tool work on a password protected site? or does that mess things up since the site is not available to all? thanks! d.

Posted by: daurie at May 10, 2007 11:13 AM

Hey Dave,

I just wanted to know if theres was any way that I can take out the padding on the search box? I want to put it in between my columns but I want it to fit snug tight without padding on top or bottom? Is that posssible?

Posted by: Guitar man at May 17, 2007 9:15 AM

You bet. Simply change that first DIV to remove the "padding" parameter:

<div style="border:1px solid black;width:20em;">

You can also tweak the width to fit your constraints too, including using a pixel count instead (e.g. "width:100px;")

Posted by: Dave Taylor at May 17, 2007 12:17 PM

Thanks Dave! It worked great! You are definitely a gentleman and a scholar. Thank you for all your help, Have good one!

Posted by: Guitar Man at May 18, 2007 10:00 AM

Dave: I tried your example and it worked like a charm. The question I have is there a way to convert the results to an iframe without the google search bar showing up?

Thanks!

Posted by: mike at May 21, 2007 3:19 PM

Hi Dave
I Have the same query as that of nick,
"I added the Google site search to my site last year. But it does not find new content.

For example, I added the terms "yankee doodle dandy" to a test pagee recently, However, upon a "site" search, it does not locate the page with that term.

Can I assume that my site must be re-indexed by Google before any new content will be found? "

if so please suggest some simpler and faster indexing method as my website content changes frequently.
Thanks

Posted by: Badshah at May 24, 2007 2:08 AM

Dave,

Great site for those of us starting a website for the first time. My question: When someone does a google search from my site, can I have it first open a new tab if using tab browsing and if they don't have tabbed browsing, then open a new page?

Much Appreciated.

Posted by: Greg Smith at May 28, 2007 9:20 AM

Badshah, you need to wait until the Google spider sees your new pages. One way for that to happen more quickly is to frequently update your site with new content, which teaches it to visit you more often.

Greg, yes, you can do that. Add "target="_blank" within the FORM tag and you'll find that the search results pop up in a new window.

Posted by: Dave Taylor at May 29, 2007 12:07 PM

how can i search in my website by using google search

Posted by: osama at June 4, 2007 4:36 AM

thanks dave for the reply, i am not exactly getting your point that site should be updated daily, does it mean i need to add pages to website or just update/change the contents of the pages/pages already present?, now in either case whatever your reply is like adding pages/changing page content , if i do it on daily basis , does that mean google will eventully index my site daily as my site is should change almost daily and customers should see changes on daily basis too , waiting for ur
reply dave, Eagerlyyyyy

Posted by: Badshah at June 13, 2007 7:36 AM

Hi dave, am having problems in locating html of my site, how do i go about it.

Thanks
Ejiro

Posted by: EJIRO at June 27, 2007 8:09 AM

Hello Dave.. I'd like to have 2 buttons instead of a google button and a checkbox.. how can I do this without the 2nd button having the full URL as it's face (value). In other words.. I would like the button face to say "LI Online" instead of www.longislandonline.com

Posted by: Peter Armenti at June 27, 2007 7:16 PM

When I click on a location from Google's search, a different website shows up. It says "jump" and then loads a website i didn't click.

Posted by: fred s. hobbs at June 30, 2007 2:13 PM

hey. this is so cool. super. thank you very much for this info. cool cool cool! :D

Posted by: mastermind at July 11, 2007 9:59 PM

Like Fred recently queried when I click on a location from Google's search, a different website shows up. It says "jump" and then loads a website i didn't click.

Posted by: Lou at July 12, 2007 5:14 PM

Hi Dave this is great thank you very much. Just wondered if you get could the search result to open a new window or tab (same as Greg Smith at May 28, 2007 9:20 AM).

Posted by: Martin LS at July 15, 2007 4:28 PM

Martin, as I said earlier in this stream of comments, yes, you can do that. Add "target="_blank" within the FORM tag and you'll find that the search results pop up in a new window. :-)

Posted by: Dave Taylor at July 15, 2007 8:58 PM

do you know how I can make the google search box search a mysql database?

Posted by: Jeff Stevens at July 16, 2007 10:18 AM

We, as HornAfrik webmasters, are glad to join to the Google host page, please help us to find the easest way we can our website in an automatically?

So that, how can we deal with this matter?

Wish you the best.

Posted by: mmguuleed at July 18, 2007 3:07 AM

How can I make this search box code, have google search two or three sites, instead of one?

thanks, Kenneth

Posted by: Kenneth at July 19, 2007 1:22 PM

Hi, Thanks a lot for the feature, but how can I add a Google Image search?

Thanks,

Tom

Posted by: Tom S at July 21, 2007 5:52 AM

Thanks Alot Dave .....

May God Bless U

Posted by: Broken Pixels at July 31, 2007 10:03 PM

how do i not give the user the option to search google.com, only my site?

Posted by: lolman at August 5, 2007 3:50 AM

How can I create a sign up box on my web site? All I want is to collect the name and email address of visitors who wish to participate.

Posted by: Gail at August 15, 2007 6:46 PM

You Rock Dave!!!!!!!!!!!!! Tanx a lot, I have a cool Search Box now on my site www.sajadghaffoor.blogspot.com tanx 2 you!keep up da good work

Posted by: Sajad Ghaffoor at August 15, 2007 11:26 PM

Deve Great job,
I was using your control on my site(old site all html pages) and it was working fine today i upload the new site but the search my site is getting me old site results can you help me.

Posted by: Arshad at August 20, 2007 10:05 AM

Hi Dave,

Many thanks for this, it's helped alot!

Cheers
Dean

Posted by: Dean at August 21, 2007 5:14 AM

Do I need Google's permision to add google search on my site?

Posted by: Kawaljit Nagi at August 21, 2007 8:30 AM

Dear contributor, copies the codes from this site and pasted it straight into a blank document under the body tag...unfortunately it was displaing the code i pasted under the preview.....PLS HELP ME OUT

Posted by: mujeeb at August 23, 2007 1:05 PM

My web site is www.ppc4you.blogspot.com. I cannot make my site on the google search even though i have submit my site into the google site map

Posted by: PPC4YOU at August 23, 2007 8:59 PM

Just wanted to point out that the checked/selected attributes as used here are not actually XHTML compliant, as they are not well-formed. A well-formed attribute is in the form selected="selected".

Posted by: matt at August 25, 2007 11:31 PM

Absolutely true. It's been a constant frustration that the code offered up by sites like Google and Amazon are often sloppy and need to be cleaned up to be standards compliant. Y'd think they could do better... :-)

Posted by: Dave Taylor at August 27, 2007 10:34 AM

Thanks
after all you are master
thanks again!

Posted by: avinas dwivedi at August 31, 2007 2:19 AM

hello u nailed my qustion right!
pls how do i have the google search results display on my site with out the google logo

Posted by: Allen at September 5, 2007 10:02 AM

Hi Dave,
How to put the Google search (powered by Google)in my website like the www.cnn.com? Thanks

Posted by: saigonman26 at September 23, 2007 1:13 AM

Thanks ALOT....I was looking for that...
I was wondering if I can add buttons to my search box like in google, I.E. image search Images News And Web...Thanks a lot again.

Posted by: Alex at September 24, 2007 2:05 PM

How does one use a graphic as the input button/ submit button? I'd rather not have the Submit button but a gif instead.

Posted by: Bryan A. at October 2, 2007 6:46 PM

Thank you so much for this awesome code!! Unfortunately, I am using this within a company intranet and when I click the search button, it tries to load in our intranet url and causes an error. It will not open in the web. I tried changing the code to open in a new window and it doesn't make a difference, our company url is still at the beginning of the address. Can you help (hope this makes sense)?

Posted by: Amy at October 5, 2007 3:57 PM

Hi Dave,
Found your site and the excellent code snippets are great. Your teaching is very clear too. I thank you sincerely,
-Vinay

Posted by: vinaym at October 19, 2007 11:18 AM

I'm making a page and on the top left is the name of the site and I want the search box on the top right. I've tried doing it but it then doesn't work because its outside the red box. How do I also move the red box so that the search box appears top right?

Posted by: Sean James Cameron at November 3, 2007 6:49 AM

How do I make a comment box like yours?

Posted by: Bob Nordele at November 11, 2007 12:40 PM

I am adding a google search and want an new window with a fixed width (say 600px wide)w ith the search results to open over the top of the website. How do I do that? Thank you so much for your help!

Posted by: Janine at November 20, 2007 3:16 PM

When I run the search on my own site, I get results, great. But when I go to those pages, I get the text, but the images don't show. Any idea why? I added your search to a page in my help file, which I created in FrontPage (that has a sucky search feature), and my help file is hosted on a google-registered site.

Posted by: Victoria at November 21, 2007 11:38 AM

Thanks this code, i shall add this to my limo hire site shortly

Posted by: leo r. at November 28, 2007 2:24 PM

We want to add our pages in googlr pages because please guide to us.

Posted by: Discover Nepal Exports at December 4, 2007 6:55 AM

Thank you, Dave Taylor for this website of yours. Humbly, a shy devotee

Posted by: Lesley Critton at December 4, 2007 10:11 AM

Thank you Dave Taylor...For days I'm searching for this code. Finally you gave it..!! Thank you.

Posted by: Saheer.N at December 9, 2007 11:33 AM

Dave, I've followed your instructions. However, the search term(s) do not transfer to the Search Page. I do get redirected to the search page, but then have to retype the serach terms. I am using my own search engine and NOT Google. Is the code different?

Posted by: Tom at December 10, 2007 3:40 AM

Tom, undoubtedly your search engine doesn't work the same way that Google does. Most importantly, you need to do a search and then look at the URL your search engine uses to identify the *name of the search term variable*. With Google, it's "q", and that's what this script produces too. If your system uses, say, "searchterm", then just tweak my script to use that variable name instead.

Posted by: Dave Taylor at December 10, 2007 12:00 PM

Hi Dave,

thanks for your code. I fairly new in this field and sometimes when i am stuck it takes for ever to figure it out. I have added a search to my site and changed the stle of it with some css, but it just won't work properly. i am looking up things that I know are in teh site, but it doesn't find them. Can you help?

Posted by: Lorinda at December 14, 2007 8:16 AM

Dave, I have been pouring over this code and I can't seem to figure out why my search box won't fill the google search textbox when I click on the button. Do I have to use a submit button? Right now I am using an image for my button and I think that may be what it has to be. I am using IE7 and when I copy and paste your code it still doesn't work. They only difference in my code is the CSS id's, etc. That won't affect the functionality of the form.

What am I doing wrong?

Posted by: Brandon at December 20, 2007 12:46 AM

Hi Dave, i need to display the search result in my website itslef. Can you help me?

Posted by: ila at December 25, 2007 10:26 PM

Dave,
I was able to add the HTML by way of your instructions regarding adding a web-site specific as well as google search engine. When I do so all I get are no finds on either the website or the net. Any ideas what is going wrong?

Posted by: Charlie at December 28, 2007 10:38 PM

Hi Dave. Maybe I've missed this somewhere, but how do I get the search to only look at one directory in my domain? I'm looking for it to only search files in my help file, but not to look in the rest of the site. I'm unsuccessful. I looked at that bot thing, and i didn't see an answer.

So, for example, it currently looks at www.mywebsite.com, but I want it to look at www.mywebsite.com/directoryA

Is there a way to do that? Entering that path simply returns o results.

Thanks

Posted by: Victoria at January 3, 2008 4:11 PM

Victoria, I've pulled your question into its own posting:

http://www.askdavetaylor.com/how_to_google_site_search_look_constrain_subdirectory.html

Hopefully that'll help you out!

Posted by: Dave Taylor at January 4, 2008 8:25 AM

Hi Dave. Thanks for this information, I have the google engine on my website ( www.mytravelicious.com) now. Just have a question- how do I put it on the center?

Many thanks

Posted by: Grace at January 8, 2008 9:36 PM

Hi,thanks alot for ur help.
How do i pu the word (GOOGLE) b4 the textfield?
Pliz assist.

Regards,

Dishon.

Posted by: Dishon at January 13, 2008 8:09 AM

Thanks Dave, you've saved me!!!

Your site is one of my favorites now :)

Posted by: Elsa at January 14, 2008 11:56 PM

I placed your google search on two of my web sites and they are great. Finditmall.com and citizenhealthwatch.com
Thanks for being a sharing person. The world needs more like you.

Posted by: Joe Holmes at January 17, 2008 10:21 PM

Dave,

My website's html layouts are fine in IE but in firefox there are some layout issues.

Can you please tell me how i can validate my website's html according to firefox and IE. The perfect solution which u recommend.

Posted by: Mutahar at January 29, 2008 12:44 PM

dave, you seem to be telling alot of people who ask about opening a search in a new TAB, the "_blank" html code, which is to open up a new window... is there one for opening a new TAB. I can't seem to find a code anywhere, and a client has requested I incorporate this kind of feature in their site search.

Posted by: cally at January 29, 2008 9:47 PM

As far as I can tell, Cally, there *is* no way to actually have a target= value that opens up a new tab; that's up to the browser software and indeed there are browsers that don't support tabs (for example, cell phone browsers).

Further, the entire target attribute is deprecated in the XHTML standard, so we should theoretically have stopped using it anyways...

Posted by: Dave Taylor at January 29, 2008 11:37 PM

Hi dave,

I need some advise regarding adding google adds on to my website.

I have given my URL above, and i got all the codes from Google and pasted on my website, but the adds doesnt seem to appear on my page, I managed to get the google search box on to my site. please help me with this.

Regards

Posted by: Fawzer Faiz at February 2, 2008 10:54 PM

Brilliant!!!!
Thank you so much

Posted by: Andrew at February 4, 2008 12:13 AM

Hi Dave, recently my Google image search button has stopped working. If I click the button leaving the query blank I get the Google image search page, but if I search for a picture it returns the regular Google results page, not the image results. It worked for months. Do you know what happened?

Posted by: Robert at February 10, 2008 8:51 PM

Hey Dave,
Do you happen to know of a way to add to the query string when the user types in a search?

For example: They type in "pit bull" and it actually searches for "dogs pit bull".

Posted by: Alex at February 11, 2008 5:25 PM

Hi Dave,
Thanks so much for helping the HTML-inexperienced (like me) with these helpful posts!
My site is hosted on freewebs (http://www.freewebs.com/routedog) and when I search site:freewebs.com/routedog on google nothing happens. Is this because my site is new, or is it that freewebs sites never come up?

Posted by: Elissa at February 11, 2008 10:16 PM

Can you make the search result pop up in another window, like this HTML code for a link:

target="_blank"

Posted by: jack at February 15, 2008 3:53 PM

Jack, yes you can do just that by adding that attribute to the FORM tag. So instead of having something like

FORM METHOD="get" ACTION="xxx"

you have

FORM METHOD="get" ACTION="xxx" TARGET="_blank"

Posted by: Dave Taylor at February 15, 2008 10:53 PM


you said if l want to use this code l should simply change the occurrences of askdavetaylor.com as appropriate.only search Ask Dave Taylor
do l have to put my url here too? or what do l do .

value="askdavetaylor.com" checked /> only search Ask Dave Taylor


thanks

Posted by: tina at February 21, 2008 2:44 PM

hello Dave,

I have added your search code in my web page but it wont work fine. My web pages are in sub folder like "abc.com/xyz"

Can u help me

Posted by: nikhil at February 22, 2008 9:28 AM

Hello Dave,

First of all great site, so much informatio.

I already use google search through my adesnse account and was wondering if it is possible to add my adsense code or to your code above or somehow tweak my google search box to look like the one you have made?

basicllay so i still get to use my google adesnse serch but have a different look.

Thank you for your time.

Posted by: Tom at February 23, 2008 9:27 AM

Dave, I just wanted to say thanks. I have a site that's heavy with original content, and I've never been very good at archiving. It is absolutely AWESOME to have this tool for my readers. You're the best!!

Posted by: JGolden at February 26, 2008 8:30 PM

Hi dave, thanks for your work, i have succesfully entered google search into my web page.But how can i make it an external link, i don't want it to open in the same window with my page.
Can you give me that code if possible.

I have also tried for several times to add my site into google but it's now about 4 months and it's not yet posted what could be the problem and what can i do?
The site is active and it's in use.
Thank you Mr.Dave.

Posted by: Richy at February 27, 2008 1:26 AM

Thanks for the nice tutorial. I searched it for 3 days before comming to this post. You made my day...
Thanks....

Posted by: Adspotlive at March 3, 2008 7:42 AM

how do you have it only show the search bar and no dial?

Posted by: pyrofool at March 4, 2008 8:59 PM

Dave, I have a new website that I bought that came with and without flash. I using the with out flash site, it much eaiser to use in Front Page. Any way my question is this. On the contact page I have a box for the person name and email that they can type in as well as a message with a submit button. How do I make this work when they click the submit botton. Do I need to add something to the code? I know how to make e-mail links and what not, but I'm not sure what to do on this. Any help is much appreciated.

Posted by: Ronnie Rokk at March 6, 2008 4:52 PM

hallu dave! thnks for ur great tips! anyway, i am trying to create / design my own site using microsoft frontpage application which i plan to publish using free server ( for testing of course ).

Therefore, i hope you could help me to include google ads + google search box into my site which i created using frontage application? thanks ya!

Posted by: lady at March 9, 2008 8:15 AM

Thanks! best help ive ever had!

Posted by: Sam Shannon at March 20, 2008 1:33 PM

Hi. l just finished making one with google before l found yours . can l delete the google one and use your code. it looks cool

Posted by: tina at March 20, 2008 5:04 PM

Thanks, Dave! This really works!

Posted by: IdeaSmith at March 21, 2008 9:05 AM

Dave, I love these pages. Make more pages!!!!

Posted by: Brian Vail at March 21, 2008 2:02 PM

Dave, I am designing a site for a friend who is an artist. She wants visitors to be able to search for images and be taken directly to that image. e.g. say she has a painting of a frog or frogs, if someone enters frog in a search box she wants all the frog paintings to show up. Is this possible? Preferably for free? Or am I asking too much.
Thanks for your help.
Chris.

Posted by: Chris at March 24, 2008 8:38 AM

Hi Dave, I'm a Realtor in Arizona and in the process of creating my 'website' and it is quite a challenge to me. How do I add the google search so it goes to my webpage?
Thanks,
Pat

Posted by: Pat at March 24, 2008 8:01 PM

Hi Dave,

is there any way to have the search function without the check box? so that it automatically searches your site first? The Box and text is taking up a lot of space and I'd like leave them out! :-)

Thanks much!

Posted by: Andres at March 26, 2008 12:28 PM

how can I get this to work for google images dave?
Any php scripts out there if not

Posted by: dan at March 26, 2008 2:16 PM

Hello Dave,
Was wondering if there is a way to get the google search, or any other search index to work within a password protected directory of a site?
Thanks,

Posted by: Rich at March 27, 2008 7:37 AM

Exactly what I needed, thanks a lot for sharing your knowledge. :)

Posted by: Jack at March 30, 2008 4:38 PM

Hi Dave. I must say you are doing a great job on this site. Thank the Heavens for people like you. I'm designing a Web directory and would like to find out if you are allowed to put a Google search box in your site without Google's permission. In the design I have already created the search box using the code I found on this site and I have also inserted the Google logo. Do I have to get Google's permission? Thanks.

Posted by: Wong Xulu at April 3, 2008 9:19 AM

thanks you

Posted by: PREFABRIK at April 3, 2008 1:44 PM

thanks a lot. its good comment.

Posted by: arti ajans at April 4, 2008 1:41 PM

Thanks, This is great

Posted by: Simon Shaw at April 7, 2008 4:13 PM

Can this be added to invision message boards? Is there any search that can be?
Thank you!

Posted by: Verla at April 12, 2008 2:02 PM

Hi,

Can u please tell me how can i make this form, running inside an asp.net form ?
The main problem is that i want the google search form integrated inside the main asp form, ( which has the attribute "runat="server" ). If i exclude the code above from the main form, everything works fine, but the search form will flow after the first one ( so, teh search will be at teh bottom of teh page). If i include teh search form in teh main form, it wont work anymore :|.
Any solution will be kindly appreciated.

Thx,
tourettehigh

Posted by: tourettehigh at April 18, 2008 1:25 AM

Just say a lot of thanks for this nice tutorial!

Posted by: fxekobudi at April 18, 2008 4:21 AM

Hi Dave,
i have a blogger blog and want to add google search to it.But i can't figure out the code.Neither the code above nor the google free code works;my main concern is that it can search lines or words in side the blog posts.I think it will work, if you help me out with the variables.My blog is at theindianbuzz.blogspot.com

Posted by: Suryansh Pradhan at April 18, 2008 7:52 AM

Dave,

I've cut and pasted your code for the Google Search and it works great, however, in the frame of the search box "maxlength 255 value=""/>" is listed. Also, at the bottom it also says "value=divine9online.com checked /> only search divine9online.co" Shouldn't that text be hidden in HTML view? Please advize. Thanks

Posted by: Mike at April 23, 2008 10:58 PM

Mike, I think your problem is that when you cut and pasted, you ended up getting some extra carriage returns in your results. The lines that you're seeing and don't expect to see, make 'em part of the previous line and you should be good!

Posted by: Dave Taylor at April 23, 2008 11:06 PM

Thanks for giving such a useful information. I have used your code on my webpage. It is looking really nice.

Thanks

Posted by: Y4Yawar at April 29, 2008 4:43 AM

How can i put current new from major web like google news, yahoo news, other etc which changes automatically with new change on the support web. I want to display news as html web links not by RSS.
Nikhil

Posted by: Nikhil at May 1, 2008 7:50 PM

I have a question about the Google search box. I set it up and it works, but it doesnt seem to seach a new directory that I put in the location. it searches all the other directories under the top level, but not the most recent one I placed there. This has been the case for four weeks now. Any ideas?

thanks

Tom

Posted by: Tom Melkonian at May 2, 2008 6:22 PM

I have a lot to say, but ...
Starbucks coffee cup I have a lot to say, and questions of my own for that matter, but most of all I'd like to say thank you for all your efforts on this Web site by buying you a chai!

I do have a comment, now that you mention it!









Remember personal info?


Please note that I will never send you any unsolicited commercial email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.


Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.