Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-30-2009, 11:27 PM   #1
In Runtime
 
Join Date: Dec 2001
Posts: 154
Default a google search box html

Can anyone tell me what is wrong with this code. I am trying to have a google, wikipedia, and dictionary.com search box on my home page. I do not want to have the search button on the page and want to hit enter to start the search. I have the code written but it does not search when I hit enter. I have even added a search button to see if that will work without any success. Here is what I have for the code:

<td width="33%"><p align="center"><strong><u><font color="#C0C0C0">Search Engine</a></font></u></strong></p>


<p align="center" form action="http://www.google.com/search">

<input type="text" name="q" value="" id="textbox">
<INPUT TYPE="Submit" VALUE="Search">

<script>document.getElementById('textbox').focus() </script></p>


</form>
__________________

Hid_Enigma is offline   Reply With Quote
Old 03-31-2009, 09:42 AM   #2
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: a google search box html

What you need is a separate form for each search box. Give each for a submit button, and the enter key will default to the submit button for that form. Make sure to give each form unique name and id attributes.

Also, form is not part of the <p> tag.
For example:
Code:
<div>
<form id="googleForm" name="googleForm" action="http://www.google.com/search" method="post">
<input type="text" name="q" value="" id="googleText">
<input type="submit" value="Search" id="googleSubmit" name="googleSubmit">
</form>
</div>
Then do that for each search box, changing the attributes where necessary.

See if that helps.
__________________

__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Old 03-31-2009, 03:53 PM   #3
In Runtime
 
Join Date: Dec 2001
Posts: 154
Default Re: a google search box html

Code:
<div>
<form id="googleForm" name="googleForm" action="http://www.google.com/search" method="post">
<input type="text" name="q" value="" id="googleText">
<input type="submit" value="Search" id="googleSubmit" name="googleSubmit">
</form>
</div>
This worked the only thing I had to change besides the attribs is method="post" to method="get"
thanks for the help
Hid_Enigma is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 11:52 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0