Solved

Is it possible to modify a google search box to search a site without using a radio button?

Posted on 2008-10-25
3
213 Views
Last Modified: 2012-05-05
I'm trying to add a google search box to my site. I want it to search only my site "www.glowfishtw.com". I don't want to give the user the option to search the whole web. I've tried adding:

             <input type="hidden" name="domains" value="www.glowfishtw.com" />

to my search form, but it doesn't work. If I use this:

            <input type="radio"  name="sitesearch" value="www.glowfishtw.com" checked />

the search works. Is there a way to make this radio button hidden? or maybe another way to go about this?

Thanks.
here is my whole code:

<form method="get" action="http://www.google.com/custom">
                  &nbsp;
                  <input type="text" name="q" size="16" maxlength="255" value="" />
                              <input type="submit" name="btnG" value="Search" />
                              <input type="radio"  name="sitesearch" value="www.glowfishtw.com" checked />
                              site search <br />

                               <input type="hidden" name="domains" value="www.glowfishtw.com" />


                        </form>      
0
Comment
Question by:elliottbenzle
3 Comments
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 200 total points
ID: 22806040
Hi Elliott,

I've not been able to figure out why Google doesn't allow this.   What I think you can do instead is just not display the radio button:

<input type="radio"  name="sitesearch" value="www.glowfishtw.com" checked style="display: none"/>

0
 
LVL 5

Accepted Solution

by:
DecKen earned 300 total points
ID: 22806042
Try this

form method="get" action="http://www.google.com/custom">
                  &nbsp;
                  <input type="text" name="q" size="16" maxlength="255" value="" />
                              <input type="submit" name="btnG" value="Search" />
                              <input type="hidden"  name="sitesearch" value="www.glowfishtw.com"/> 
                              site search <br />
 
                               <input type="hidden" name="domains" value="www.glowfishtw.com" />
 
 
                        </form> 

Open in new window

0
 
LVL 4

Author Comment

by:elliottbenzle
ID: 22807101
       <input type="hidden" name="sitesearch" value="www.glowfishtw.com" />

this did it. Thanks severyone.
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question