a google search box html

Hid_Enigma

In Runtime
Messages
154
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>
 
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.
 
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
 
Back
Top Bottom