The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Help with this form? (Beginner)
slowbro
post Dec 14 2011, 07:26 PM
Post #1





Group: Members
Posts: 3
Joined: 14-December 11
Member No.: 16,071



Here's what I have:

CODE
</form>
<script type="text/javascript">
var domainroot="(site:www.example.com)"

function Gsitesearch(curobj){
curobj.q.value=domainroot+" "+curobj.qfront.value
}

</script>


<form action="http://www.google.com/search" method="get" onSubmit="Gsitesearch(this)">

<p><b>Search Site<br />
<input name="q" type="hidden"/>
<input name="qfront" type="text" style="width: 180px" /> <input type="submit" value="Search" /></b></p>

</form>


This code sends you to google and searches what you put in the form, but my goal is to put the google search in an iframe (or something more aesthetically pleasing) on my site. It can't be that difficult because I see it on almost every site I visit. Can anybody help me, or send me a site that will help with this?

Thanks very much,

-T
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies(1 - 4)
pandy
post Dec 15 2011, 01:08 AM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 14,917
Joined: 9-August 06
Member No.: 6



Use the target attribute.
http://htmlhelp.com/reference/html40/forms/form.html
http://htmlhelp.com/faq/html/frames.html#frame-target


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
slowbro
post Dec 15 2011, 10:30 AM
Post #3





Group: Members
Posts: 3
Joined: 14-December 11
Member No.: 16,071



Thanks so much!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 15 2011, 10:54 AM
Post #4


.
********

Group: WDG Moderators
Posts: 5,620
Joined: 10-August 06
Member No.: 7



Side-note: should you have parenthese here:

CODE
var domainroot="(site:www.example.com)"

? I don't think Google uses them.



--------------------
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
slowbro
post Dec 15 2011, 04:16 PM
Post #5





Group: Members
Posts: 3
Joined: 14-December 11
Member No.: 16,071



QUOTE(Christian J @ Dec 15 2011, 10:54 AM) *

Side-note: should you have parenthese here:

CODE
var domainroot="(site:www.example.com)"

? I don't think Google uses them.


Oh you're right, thanks!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2014 - 04:08 AM