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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Understanding mobile browsers 9 84
Asp in server side with Mssql Server 7 4 26
SSRS 2016 Rendering HTML tables 3 25
.htaccess css/images no longer loading 4 35
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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.…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

789 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