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
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

632 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