School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,148 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,734 people online right now. Registration is fast and FREE... Join Now!




custom button and google search

 

custom button and google search, can it be done?

IngeniousHax

2 Nov, 2009 - 04:09 PM
Post #1

D.I.C Addict
****

Joined: 28 Mar, 2009
Posts: 630



Thanked: 15 times
My Contributions
So me and an acquaintance are looking at throwing up a search engine that uses googles' search, however, we were curious can you use a cutsom button to do a google search? Not too sure about this as I am not a web developer of any kind, but I imagine you could just place a code behind the button to use google search right?

If so, could some links or anything be thrown out at me to look over?

User is offlineProfile CardPM
+Quote Post


iphoneorange

RE: Custom Button And Google Search

2 Nov, 2009 - 04:50 PM
Post #2

D.I.C Head
Group Icon

Joined: 20 Aug, 2008
Posts: 145



Thanked: 17 times
Dream Kudos: 75
My Contributions
well, technically the button doesn't perform the search, the form does. the button is a launcher so to speak biggrin.gif

is this what you had in mind?
HTML
<form action="http://www.google.com/search" name="searchbox" 
method="get" style="margin-left: 2em;" />
<input type="hidden" name="hl" value="en" />
<input type="hidden" name="ie" value="ISO-8859-1" />

<input maxlength="256" size="40" name="q" value="" />
<input type="submit" value="find it" name="btnG"
style="font-size:75%;" />
</form>


that will perform a google search, and you can add lines to make it speacial. for example:

HTML
 <input type="hidden" name="sitesearch" value="dreamincode.net" /> 


the line above makes it search only dreamincode.net from google biggrin.gif

Also, Google offer a custom search service, which can be found here smile.gif
http://www.google.com/cse/?v

hope i helped biggrin.gif

P.S. by custom button did you mean custom visually? or as in custom to make it search google?

This post has been edited by iphoneorange: 2 Nov, 2009 - 05:12 PM
User is offlineProfile CardPM
+Quote Post

IngeniousHax

RE: Custom Button And Google Search

2 Nov, 2009 - 09:17 PM
Post #3

D.I.C Addict
****

Joined: 28 Mar, 2009
Posts: 630



Thanked: 15 times
My Contributions
Yeah, I meant visually. But is there also a way to center a button underneath the search bar (a custom button).

So in other words, you would have to take the script and inject it into the button and than center it underneath the search bar, right? or no?

And if i'm wrong, please correct me as I have no idea on what to do.

Also, that script you gave out, does it just do a google search from a search button...?
User is offlineProfile CardPM
+Quote Post

tharam04

RE: Custom Button And Google Search

3 Nov, 2009 - 01:26 PM
Post #4

New D.I.C Head
*

Joined: 27 Feb, 2009
Posts: 13



Thanked: 1 times
My Contributions
QUOTE(IngeniousHax @ 2 Nov, 2009 - 11:17 PM) *

Yeah, I meant visually. But is there also a way to center a button underneath the search bar (a custom button).


Yes. You can put the form within a paragraph and then have the search box above the search button like so
CODE

<p style="text-align: center;">
<input type="text" name="search" /><br />
<input type="submit" value="Search" />
</p>



QUOTE(IngeniousHax @ 2 Nov, 2009 - 11:17 PM) *

So in other words, you would have to take the script and inject it into the button and than center it underneath the search bar, right? or no?

And if i'm wrong, please correct me as I have no idea on what to do.

Also, that script you gave out, does it just do a google search from a search button...?

No. The script goes into the form command. If you wanted, you could have the search criteria box one one side of the page and the submit button on the other side of the page biggrin.gif although I wouldn't recommend that.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 04:01PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month