Solved

Just one input box

Posted on 1998-10-31
3
166 Views
Last Modified: 2010-04-09
Hi there,

Many search engines enable you to place an input box and link to their sites. This way you can search their data bases. One often sees pages with many input boxes beneath each other.
I want to create a page with just one input box and a pull-down menu. One must be able to <select> one of the options (just like on the home pages of Netscape and Microsoft). How can I do this?

Below I have included the code for *separate* links to AltaVista and Excite.


<HTML>
<HEAD><TITLE>Search</TITLE>
</HEAD>
<BODY>
<CENTER>
<TABLE CELLSPACING=0 CELLPADDING=0 WIDTH=500><TR><TD>&nbsp;</TD></TR><TR><TD VALIGN=top><A href="http://www.altavista.digital.com">Alta Vista</a><BR></TD><TD VALIGN=top><font size=3> <FORM method=GET action="http://www.altavista.digital.com/cgi-bin/query"> <INPUT TYPE="hidden" NAME="pg" VALUE="q"><INPUT NAME="q" SIZE=30 MAXLENGTH=200 VALUE="">&nbsp;<INPUT TYPE =submit VALUE="  Search  "><INPUT TYPE="hidden" NAME="what" VALUE="web"><INPUT TYPE="hidden" NAME="fmt"  VALUE=""></FORM></font>
</TD></TR>

<TR><TD VALIGN=top>
<a href="http://www.excite.com">Excite</a><br></TD>
<TD VALIGN=top><FONT SIZE=3><FORM ACTION="http://www.excite.com/search.gw" METHOD=POST><INPUT TYPE="hidden" NAME="searchType" VALUE="Concept"><INPUT NAME="search" SIZE=30>&nbsp;<INPUT TYPE="submit" NAME="submit" VALUE="  Search  "><INPUT TYPE="hidden" NAME="category" VALUE="default"><INPUT TYPE="hidden" NAME="mode" VALUE="relevance"><INPUT TYPE="hidden" NAME="showqbe" VALUE="1"><INPUT TYPE="hidden" NAME="display" VALUE="msn,hb"></FORM></FONT>
</TD></TR>

</FORM></FONT>
</TD></TR></TABLE>
</CENTER>
</BODY>
</HTML>

Thanks in advance

0
Comment
Question by:Maas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
borup earned 150 total points
ID: 1839329
You need a Javascript or CGI-Script to redirect the user to the chosen site. I have made a Javascript which does what you want. To add a new site you just need to add a new option. You can't get it easier :-)

borup

<HTML>
<HEAD>
  <TITLE>Search</TITLE>
</HEAD>

<BODY>

<SCRIPT>
<!--

function doSearch() {
  index = document.searchForm.site.selectedIndex;
  site = document.searchForm.site[index].value;
  searchString = document.searchForm.searchString.value;
 
  location.href = site + searchString;
}

//-->
</SCRIPT>

<CENTER>

<FORM NAME="searchForm">

<TABLE CELLSPACING=0 CELLPADDING=0>
  <TR>
    <TD>
      <INPUT TYPE="TEXT" NAME="searchString" SIZE=30 MAXLENGTH=200>
    </TD>
    <TD>
      <SELECT NAME="site">
        <OPTION VALUE="http://www.altavista.com/cgi-bin/query?pg=q&q=">Alta Vista
        <OPTION VALUE="http://search.excite.com/search.gw?trace=1&search=">Excite
      </SELECT>
    </TD>
    <TD>
      <INPUT TYPE="BUTTON" VALUE="Search" onClick="doSearch();">
    </TD>
  </TR>
</TABLE>

</FORM>

</CENTER>

</BODY>
</HTML>
0
 

Author Comment

by:Maas
ID: 1839330
Thanks a lot borup!! It really can't get easier.
0
 
LVL 1

Expert Comment

by:borup
ID: 1839331
You're welcome ;-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding a countdown to HTA 12 114
How to escape unsafe HTML tags 4 50
Timer on div 5 36
JavaScript character count without counting spaces in Textarea (Code provided) 3 55
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question