Tuesday, March 2, 2010

Local site Google search - not working???

I have implemented what I think is a search feature for my own website (albiet my site is nothing but a shell), however the search function (form) only searches the page that the search feature is on, not my whole site.

Can anyone shed any light on why this is happening?

my XHTML:



<div id="GoogleSearch_Container" style="position: absolute; top: 115px; left: 325px; font-family: Courier New; font-size: 10pt;">
<form action="http://www.google.com/search" method="get">
<input name="q" value="Tim Berners-Lee" type="text">
<input value="SEARCH" type="submit">
<input name="sitesearch" value="" type="radio">The Web
<input name="sitesearch" value="carlsportfolio.50webs.com/" checked="checked" type="radio">This Site
</form>
</div>

3 comments:

  1. Hi Carl,

    I had a quick google for some similar code and found this page
    http://www.askdavetaylor.com/how_can_i_add_a_google_search_box_to_my_web_site.html

    The difference from this code to yours seems to be this line
    <input type="radio" name="sitesearch"
    value="askdavetaylor.com" checked />

    Perhaps you can try replacing your line with this one
    <input type="radio" name="sitesearch" value="carlsportfolio.50webs.com" checked />

    Let me know how it goes
    Oanh

    ReplyDelete
  2. Hi Oanh,
    Thanks for your help on this one, however it is from "Ask Dave Taylor" that I originally got the search method from. Unfortunately, there seems to be some of my code that is not showing in my example above due to insufficient width space in the blog.
    I do have the radio button checked already as you would see if you go to my actual site (pardon the incompleteness of it). Have you tried to implement as search into a site before? Did it work?

    ReplyDelete