Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Just one input box

Posted on 1998-10-31
3
Medium Priority
?
170 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 600 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

718 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