Industry guru Dave Taylor offers tech support on technical and business topics, including iPhone, iPod, Microsoft Windows, Sony PSP, cellphones, online advertising, CSS, Web design, business, Unix, Linux, SEO, Mac OS X, and shell script programming.     


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!


Related HTML, JavaScript and Web Site Programming articles:
✔   How to Create Predefined Google Image Search Links?
Thanks for the Amazon URL [see Creating Amazon Search Links]. That worked beautifully. In fact, I sent you $5.00 for coffee in thanks....
✔   Can I embed a Facebook search box on my blog site?
I've seen your articles about how to add a Twitter or Google search box on a Web page, but I have a tougher...
✔   Can I use CSS for drop shadows on my blog?
I want to give my site a bit of a facelift and add some neat graphical elements. One of which is drop shadows....
✔   How can I embed interactive photo panoramas on my site/blog?
I read through your blog entry about how to take panoramic photos with iOS 6 and an iPhone 5 and got enthused. I've...
✔   How can I create a Twitter search URL shortcut?
I'd like to add a few Twitter search links to my Web site. Is that possible, or does Twitter prohibit this sort of...

Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
    Enter your name: and your email addr:  








Reader Comments To Date: 817

nikhil said, on February 22, 2008 9:28 AM:

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

Tom said, on February 23, 2008 9:27 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.

JGolden said, on February 26, 2008 8:30 PM:

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!!

Richy said, on February 27, 2008 1:26 AM:

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.

Adspotlive said, on March 3, 2008 7:42 AM:

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

pyrofool said, on March 4, 2008 8:59 PM:

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

Ronnie Rokk said, on March 6, 2008 4:52 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.

lady said, on March 9, 2008 8:15 AM:

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!

Sam Shannon said, on March 20, 2008 1:33 PM:

Thanks! best help ive ever had!

tina said, on March 20, 2008 5:04 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

IdeaSmith said, on March 21, 2008 9:05 AM:

Thanks, Dave! This really works!

Brian Vail said, on March 21, 2008 2:02 PM:

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

Chris said, on March 24, 2008 8:38 AM:

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.

Pat said, on March 24, 2008 8:01 PM:

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

Andres said, on March 26, 2008 12:28 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!

dan said, on March 26, 2008 2:16 PM:

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

Rich said, on March 27, 2008 7:37 AM:

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,

Jack said, on March 30, 2008 4:38 PM:

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

Wong Xulu said, on April 3, 2008 9:19 AM:

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.

PREFABRIK said, on April 3, 2008 1:44 PM:

thanks you

arti ajans said, on April 4, 2008 1:41 PM:

thanks a lot. its good comment.

Simon Shaw said, on April 7, 2008 4:13 PM:

Thanks, This is great

Verla said, on April 12, 2008 2:02 PM:

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

tourettehigh said, on April 18, 2008 1:25 AM:

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

fxekobudi said, on April 18, 2008 4:21 AM:

Just say a lot of thanks for this nice tutorial!

Suryansh Pradhan said, on April 18, 2008 7:52 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

Mike said, on April 23, 2008 10:58 PM:

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

Dave Taylor said, on April 23, 2008 11:06 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!

Y4Yawar said, on April 29, 2008 4:43 AM:

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

Thanks

Nikhil said, on May 1, 2008 7:50 PM:

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

Tom Melkonian said, on May 2, 2008 6:22 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

Imran Rahi said, on May 15, 2008 7:01 AM:

Hi,

I am developing a site and I want users to enter keywords and look for similar pages on my own site. I mean the search should be restricted to my site only and I should show the listing alike google does.

Does google help us in such requirements?

Thanks in advance.

Yuda said, on May 17, 2008 5:31 AM:

How can i add a google search in my web (www.illusion.novoya.com)

jb said, on May 19, 2008 5:54 AM:

This must be some kind of joke. What are you doing coming up with 'solutions' using inaccessible tables and deprecated rubbish like target="_new"???? Ever heard of CSS and XHTML Dave? Bring your coding skills up to date, man!

Debbie said, on May 19, 2008 2:34 PM:

Hi, I am trying to build a family history site, but wish to keep living peoples information in password protected pages for security. Seriff web plus 9 does not do this, but they have suggested using a third party html code do you have any such codes or do you know where i could find them?

Dave Taylor said, on May 20, 2008 7:17 AM:

jb, of course I've heard of CSS and XHTML. Heck, I wrote a book about 'em. If you go back and read the code I present, it's certainly XHTML compliant. In terms of using "deprecated" elements like 'target', I find that the newer ways of accomplishing these sort of capabilities are so clunky and awkward, that I view it as typical committee-speak goofiness and ignore that it was deprecated. Just because something is agreed upon by a committee doesn't mean it's an improvement!

For example, it may be "wrong" to use something like <b> but if you don't want to learn CSS styles, "span", etc etc., it's sure darn easy for people to learn and remember. What's more important anyway, that it be "right" according to some committee, or that it be usable?

Josh Fialkoff said, on May 24, 2008 11:13 AM:

Hi Dave,

This is a great blog... thanks so much!

I am trying to use the Google Custom Search tool (http://www.google.com/coop/cse/).

The site I am doing this for (www.dawnnelson.org) is black, so I would like the results-page text to be white.

However, I need the query text to be black, because the box background is white.

I have looked through your blog post, but have not seen that topic discussed.

Can you please explain the best way to do this?

BTW, I had tried the AJAX version, but had the same problem with text color, so I reverted to the two-page version.

Thanks,
Josh

luise said, on May 29, 2008 3:53 PM:

Hi there-

Thanks so much for help with adding google search tool.

Next...how to add a box or something where it says, Digg this and Stumble this, etc.

Much appreciated!

Abul said, on June 3, 2008 11:11 AM:

Can u please tell me how can i make this form, running inside an asp.net form. because if i put this form inside the main form which has a "runat=surver" tag then the search doesn't work but if i put it outside of the main form, it works fine. Please help me to solve this problem.

Manila Boy said, on June 4, 2008 6:33 AM:

i've been trying to figure this out for weeks,
and thanks to you, i now have my own personal
site search.

as we say hereabouts,

"Maraming Salamat, Dave!!"

(many thanks, dave!!"

yilmaz said, on June 10, 2008 4:51 AM:

thanks dave :)

Michael said, on June 20, 2008 3:21 PM:

Sweet Post!

Google search is also a pretty good way to monetize your site by directing users to search through your site daily and often click on advertised ads through your adsense account-earning you cashola!

Trozza said, on June 22, 2008 3:10 AM:

Hay, thanks for the script Dave, worked great, but like a few other comments have asked as well, is there any way to search google images by simply clicking on a check box or something before hitting submit?

Thanks again
Troz

Richie said, on June 23, 2008 7:45 AM:

Keep up the good work.

I think by offering people the basics of coding then you don't scare them off, and therefore you give them the confidence to move forward and learn more.

There's no doubting that you're an intelligent guy, but you also possess a natural aptitude for teaching.

shantanu said, on June 25, 2008 1:22 PM:

Hi Dave,
This blog seems to be very helpful and hope my problem would be solved as well.I have pasted the code provided by you for the google search box in my site (http://dngc.tripod.com).
But the problem is that whenever I search anything within my site it doesn't searches all the pages rather it searches the index page only.I have used frames in the site,is that the reason for the problem.If it is then pliz provide me with a code so that it searches all the pages.

Mikle said, on July 5, 2008 5:57 PM:

You don't need google. The problem with google is that it index your site very randomly and not very often, so if you have a site which is very dynamic (i.e its contents change and new content is changed every now and then) then you need your own search tool as you want your users to get the latest results. The best that I have come across is Smart Spidey. It's the cheapest out there and works better than some of the most expensive search tool. It has a interesting Did you mean function and you can index your site anytime. Check it out at : http://www.smartspidey.com

george paily said, on July 12, 2008 4:38 AM:

I HAVE TO ADD A GOOGLE SEARCH BOX ON MY SITE

wsb said, on July 17, 2008 2:14 AM:

I know this is a few years old but THANKS. Was trying to solve this problem - had been using an icky widget for the past several weeks and had to look at GET WIDGET beneath it as a tradeoff - but this does the same thing, simply and more elegantly. On behalf of all of us who are BIG on content and SMALL on coding ability, thank you!!!!

Barry said, on July 21, 2008 11:21 AM:

Dave,

I've been trying to add a google search box on my website, however, when I copy the code you provide into a page on my website it gives me an error that says Internet Explorer cannot display the page. I am using Dreamweaver and have the page setup in tables. If I copy the code into a blank page it works fine. What am I doing wrong?

Suzie Tomkins said, on July 22, 2008 11:27 PM:

I am in the process of revamping our website and was looking for "how to insert search button into website". I was very lucky to have stumbled upon this site! Thank you Dave, I used your code to insert a google search bar :) YOU ARE A LEGEND!!!

robb said, on July 25, 2008 2:34 PM:

I Cannot Get The Code To Search My Site It Does Not Find Things but when i unclick the search my site only it searches for google
heres the code

only search ps3dexter.ca.tp


Any ideas what i did wrong?

Tj said, on July 31, 2008 2:53 PM:

Hi...
How can I add a Google (PDF, PPS, DOC, XlS, SWF) search box to my Web site?

I am trying to add special search on my website. I need to search for special file, I am looking for a search box with radio buttons to choose what type of file you want to search.

Thanks


cheryl said, on August 4, 2008 6:48 AM:

hi

i am currently developing in Visual web developer with a masterpage

when i add the code and click on the search it just directs me back to my page...if i paste the code in the head of the content place holder it still does not work??i am pretty deperate for it to work

aAnura said, on August 16, 2008 10:48 AM:

I HAVE BLOGSPOT WEB SITE I NEED ADD , GOOGLE SERCHING BAR, ITRY 5-6 TIME STILL I CANT ADD PLS HELP ME

Ralph said, on August 21, 2008 4:24 AM:

Hi, Dave,
I would like to add code to a web page on my site that contains a single form input field. I would like site visitors to have the cursor go right to the entry for that input field.

I think I read about that a long time ago and I have spent a lot of time today trying to figure out how to describe the HTML coding question. I like your site and I think you have already described this somewhere but could not find it.

You can email me at my email address that I entered if you have the code for that. And...THANKS for all the good help you have given; others have acknowledged the helpful info that you provide.

Signed -- Ralph

RAVINDER KUMAR RAWAT said, on August 22, 2008 11:57 PM:

I was looking for nice and attractive GOOGLE ADSENSE FOR SEARCH BOX. Is it legal to change the coding of ADSENSE FOR SEARCH??
Thanks

petter said, on September 2, 2008 12:20 PM:

Thanks Taylor. I'm using the code on my website and it works great.

K said, on September 3, 2008 12:10 PM:

Just wanted to say that your table/CSS suggestion above worked AWESOMELY for me, and thank you so much for the simple tutorial.

noughtypixy said, on September 7, 2008 7:17 AM:

want to give the choice between images and web search and have managed to get image search by changing the first line to
(form method="get" action="http://images.google.com/images?"target=blank)

have been trying to make an option to search all of the web but the way that I have tryed just adds it onto the end of the action rather than replacing it any tips??

here is what i have been trying that dosnt work
(input type="text" name="q" size="31"
maxlength="255" value="fairy" /)
(input type="submit" value="Search" /)

(input type="radio" name="sitesearch" value="" checked /) google image
(input type="radio" name="sitesearch" value="http://www.google.com/search?"/>google
(br /)

(/form)

in the actual code have used pointy brackets but that made it go invisibal here ;)

Branimir said, on September 11, 2008 2:30 AM:

hello Dave, here is the problem i am having, i have implemented your search box on my web site, but it doesn't work. I think it is a form problem. Could you have a look on my web site and add some suggestions. I will appreciated greatly.
Regards.
Branimir

jane said, on September 14, 2008 1:25 PM:

Is there a way to have a search for just one folder, for part of the site?
Ok, here is what I am doing, I have piggybacked a personal/family history and photographs site onto my main site, where I enter the url for my site, then a / then the folder name where the second site is with a new index page...

This part has gotten unwieldy and would like it searchable...
Is that possible? or is it un-google friendly?

noughtypixy said, on September 15, 2008 11:37 AM:

branimear you need to move the FORM eliments inside the DIV tags then it will work

Branimir said, on September 17, 2008 1:01 AM:

I did that, now it work perfectly, thank you for answer.
I have another question, why does the search engine list sites (database products) which a have deleted, in Google analytics that is shown as bad url, but the id number of the product (and product) doesn't exist in my database.

Jason Vandenbrink said, on September 17, 2008 4:07 PM:

Will google be okay with me following this advice? Also, will adding a link from my site to google affect my page rank at all?

sadek said, on September 19, 2008 3:52 AM:

how do u make the google search for all pages within ur site because i want the google search tool to search pages of mine such as www.freecoursework.co.cc/dida.html, can you plz tell me how i can add more sites for the search results.

surya said, on September 22, 2008 4:03 AM:

how to add the my website togoogle search

Fritz Lehman said, on September 23, 2008 8:44 PM:

Thanks a million! I had a good search box on my website once, but over time the code got messed up and it no longer worked. Also I think google changed their search box thing since then, so I can't make a new one (easily anyhow). This saved me! Thanks again, hope you don't mind that I modded it for my needs.

sadek said, on September 24, 2008 2:57 AM:

does your site have to be on google search engine before you can use this search tool?

Lyricist said, on September 26, 2008 4:04 AM:

nice post. I will try...

Simon said, on September 26, 2008 9:47 AM:

Hi David,

Great topic.

I have managed to get the code t work in a standard html page fine, however when I have added it to my CMS template...well nothing works :-(

I have no idea why this is, have you had any history with the code snipet being inserted into immediacy CMS???

Thanks,

Simon

Matt said, on October 5, 2008 11:33 PM:

Nice! This beats having to set up php!

Diane said, on October 7, 2008 11:46 AM:

Hi Dave,
How do i make the search box to search with a different search engine Not the Google search Engine and display the results on the same page and Not in a new window.
In your code you have "
" Can I replace the Action with different search eninges. You think this will work? or how do I make to search within our own search engine and within our own site.

Jim Ankan said, on October 8, 2008 11:30 AM:

Thanks for everything Dave....

cyndi whittley said, on October 13, 2008 8:51 PM:

This is pretty awesome, I've been looking for this code for a while for my site http://theinternetbiz.com

sud said, on October 16, 2008 2:41 PM:

Hi Dave,
How to add more than one website in my 'my site search' - i have two family sites, with common home page. Tks !
Sud

Discount Travel Portal said, on October 22, 2008 2:25 AM:

It's useful, however, I'd prefer to have a searcher that doesn't have the Google looks at all.

:S

LN said, on October 27, 2008 8:42 PM:

Thanks So much for the info- It helps me tremendously!

Pier said, on November 9, 2008 6:06 AM:

Hey Dave,
thanks for all the help re:adding google search box to web site... BUT, what I really want to do is have a button that when clicked will submit a SPECIFIC querry to google from within my web page.
I guess its the equivalent of replacing the querry box input mechanism with a predefined text string... how do I do that? or... maybe just being able to pass parameters to google search... is any of this possible?

Spider said, on November 9, 2008 9:14 AM:

This has been a massive help to me - been digging and thinking on this for months. My top tip to people would be to double check the scripting for typos when you amend it to your own website. Even though i copied and pasted, i still forgot to delete some bits when I added my own site details. it WILL and DOES work! If u have any probs, double check the script on your html page.
This worked fine in Frontpage 2000.
Thanx again!

Moustafa said, on November 11, 2008 5:12 AM:

Just was wondering how do you actually activate and use the google search? it seems like it you only to google's home page without submitting the query.

how do i fix it?

Dave Taylor said, on November 12, 2008 9:40 AM:
moreyn kamenir said, on November 16, 2008 10:19 AM:

So happy that I found your site! Everytime I put Amazon in my search box [on my regular explorer page], it gets me to Amazon, then adds tons of letters to my search and it flips over to Google image search and cannot find what I'm looking for. Even though it just took me off the page that I wanted. This only seems to happen at sites where cookies are needed. I have done EVERYTHING suggested to enable cookies. I am on medium security as well. Why is google image search stuck on to my yahoo search bar? Help? Thank you in advance for understanding and helping.

John said, on November 17, 2008 9:37 AM:

Hi Dave,

Being a bit slow, I wonder if you can help.

Rather than having to load the Google Toolbar, is there a way I can simply replicate the Google search box on my intranet, ie Search the web with a check box option for the World or just the UK.

Can you advise what code I need?

Many Thanks.

Regards,

John

iverson said, on November 17, 2008 1:53 PM:

do you know much about system development

Zii said, on November 25, 2008 10:06 AM:

Thanks for your useful google search codes hopefully i will be able to add them to www.ziigames.co.uk www.jllmarketing.co.uk www.pembrokeshire-sports.co.uk soooon!

faisal mehmood said, on November 29, 2008 7:06 PM:

please add this page if any body write azaan, quran naat on search bar.

Leee said, on December 2, 2008 10:24 AM:

Dave,

How do I add a search box & button as you have above that will search my site only, without having to have either the radio button or check box options? I just want to have the search box and button and nothing else..

thanks!!

Mike said, on December 10, 2008 11:09 PM:

Hi, is there a way to search two domains? I want two sites searched only.

Thanks

Danish said, on December 13, 2008 5:40 AM:

Dear Sir,

5 month before i was join NIIT they assured me that they will expert me in web designing after 3 month they told me your course is complete & they didn't teach me & eat my money Rs 4000/- thousand & give me a certificate, still i am trying to learn web-designing online. i make a webpage in frontpage but i hv a few problem that is my webpage is working well in my computer if i check another computer so the webpage is not working well i mean resolution problem.let me know the some tips about webdesigning any one can help me.

Nandy said, on December 16, 2008 5:07 AM:

Hallu.. Love you all...

Asif said, on December 17, 2008 11:01 PM:

Thanks Dave...Your code worked on the first try.. thanks for sharing...

nick said, on December 18, 2008 3:22 AM:

Hi Dave, ive been trying to get my contacts page to send the information filled in the form to be sent to my email address, but to no avail. i have mae the form in html and it calls a php file that collects the data and posts it. i thought this would work but it aint. please assist me.

Thanks in advance.
Nick

sam said, on December 19, 2008 8:37 AM:

can you add a comment box into freewebs?
I've tried but it doens't work

ASIF SHAIKH said, on December 22, 2008 5:10 AM:

Thank you Dave, this article has helped me very well. I am searching for this type of help from long ago. I will definitely divert my friends to this article. Thanx again

Nick said, on December 26, 2008 11:48 PM:

Great job, thanks for explaining how it works. You can also change language of the search in Google by changing the'action="http://www.google.com/search"

I needed Korean, so I changed it to 'action="http://www.google.co.kr/search"

Thanks

Daniel Bowen said, on December 28, 2008 7:21 PM:

Hi,
Just wondering wether it would be possible to make it search more than one site??

Tamina said, on December 30, 2008 6:21 AM:

<input type="submit" value="search" />

how do i make this pop up to a new window?

Dave Taylor said, on December 30, 2008 8:30 AM:

Tamina, just add

target="_blank"

to the FORM element. Not the input element.

suman said, on January 2, 2009 12:49 AM:

i have to add the search engine box in my web page.

Lon Britton said, on January 8, 2009 6:29 PM:

Dave,

I successfully added the Google site search box. I have an unpublished storefront of about 7 pages. How do I modify your code so the search will only search specific pages that I identify, ie. my storefront pages only. I know I must have the pages indexed by Google before the search will work. Each page is sequential and are named like so: storefront, storefront2, storefront3, etc. Will I need some wild card code or will I need to repeat each page. To clarify which code I'm speaking of I have pasted it below(it has my domain name inside). Thanks, Lon

Search Site box

<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="outdoor-photography-topic-gallery.com" checked /> only search

Outdoor Photography Topic Gallery<br />
</td></tr></table>
</div>

</form>

Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

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











I will never send you any unsolicited email. Ever.






Check This Out Too...

 
Look for Answers
Need Help? Ask Dave Taylor!


Follow Me on Pinterest

Find Me on Google+
ADT on G+
© 2002 - 2013 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site. Further, 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. My lawyer says "Thanks".
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.