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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
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 position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

749 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