Would this be possible?  | |
January 8th, 2003, 03:08 PM
|
#1 (permalink)
| | Member
Join Date: Jan 2003 Location: England
Posts: 165
|
Hi guys/gals... i got inspired by this thread, to do with adding a search box on your own site. Well im much more an arty type than a html type, so i know how i want it to look/fit on my page, i just dont know how to do it, or if its possible.
Did that make sense? O_o!
Hopefully the attached image will make it clearer, the red box is where i would like a text box for people to type in stuff, the yellow box would be the "Go!" button.
If this is too hard just tell me to go away, please bear in mind my html and javascript skills are *cough* limited *cough*... i know OnMouseOver, thats about it
Any help is appreciated.
__________________
~Fade2Grey
|
| |
January 9th, 2003, 07:01 AM
|
#2 (permalink)
| | Member
Join Date: Jan 2003 Location: England
Posts: 165
|
Not easy enough to expliain in a quick answer huh?
np. |
| |
January 9th, 2003, 09:16 AM
|
#3 (permalink)
| | ph34r t3h g04t
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 19,594
|
Well, you need to use a form to get the text from the user.
Second, you need to parse apart the text from the user when he hits the go button.
Next you need to learn the search string criteria for a search site (I recommend google).
Now you have you little javascript create a URL based on the input of the user and the search engine criteria.
I would bet that if you google for 'add search field to website' you will find some code to do exactly what you're looking for. |
| |
January 9th, 2003, 09:54 AM
|
#4 (permalink)
| | Member
Join Date: Jan 2003 Location: England
Posts: 165
|
argh... so i found the code i needed from google, and tried to put it into a table and stuff. There is one table cell with 3 things in a line from left to right -- a picture, then the text box, then the button.
but it wont align them up
i want the text box and button to be pretty much touching the top of the table cell.
this is the background of the table cell:
this is the picture on the far left (that aligns itself well):
the reason i added the picture instead of having the text in the background image is because i didnt know how to move the boxes over so i though by using a pic i could "push" them over to the right... it worked... kinda...
this is my code... Code: <HTML>
<HEAD>
<TITLE>Google Search Box</TITLE>
</HEAD>
<BODY TOPMARGIN=0 BOTTOMMARGIN=0 LEFTMARGIN=0 RIGHTMARGIN=0 BGCOLOR=RED>
<br><br><br><br><br><br><br>
<!-- End Search Google -->
<FORM METHOD=GET ACTION="http://www.google.com/search">
<TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000">
<TR>
<TD BACKGROUND="Image1.jpg" WIDTH="301" HEIGHT="30">
<IMG SRC="Image2.jpg" WIDTH="109" HEIGHT="30" BORDER="0">
<INPUT TYPE=text NAME=q SIZE=16 MAXLENGTH=255 VALUE="">
<INPUT TYPE=submit NAME=btnG VALUE="Go!">
</TD>
</TR>
</TABLE>
</FORM>
<!-- End Search Google -->
</BODY>
</HTML>
anyone see what the prob is?
EDIT: Here is what it does =/
Last edited by Fade2Grey : January 9th, 2003 at 09:56 AM.
|
| |
January 9th, 2003, 07:28 PM
|
#5 (permalink)
| | Senior Member
Join Date: Oct 2001 Location: Alberta, Canada
Posts: 563
|
add align=left to the img tag
ex: Code: <!-- End Search Google -->
<FORM METHOD=GET ACTION="http://www.google.com/search">
<TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000">
<TR>
<TD BACKGROUND="Image1.jpg" WIDTH="301" HEIGHT="30">
<IMG SRC="Image2.jpg" WIDTH="109" HEIGHT="30" BORDER="0" align=left>
<INPUT TYPE=text NAME=q SIZE=16 MAXLENGTH=255 VALUE="">
<INPUT TYPE=submit NAME=btnG VALUE="Go!">
</TD>
</TR>
</TABLE>
</FORM>
<!-- End Search Google -->
worked in my tests(ie5.5/ns4.78/opera6.03)
cheers!  |
| |
January 9th, 2003, 07:46 PM
|
#6 (permalink)
| | Member
Join Date: Jan 2003 Location: England
Posts: 165
| |
| |
January 13th, 2003, 03:17 AM
|
#7 (permalink)
| | Ultimate Member
Join Date: Nov 2002 Location: Boise, Idaho
Posts: 2,782
|
Have a link to the finished product?
__________________
JOIN [FaD] | TEAM NUMBER 2037 | http://www.techimo.com/forum/t121132.html
|
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |