Radio button multisearch form

I was hoping that you could help me with a little javascript problem
that I have.
While surfing around the net I have come upon some multiple search
forms. They use one input field to access numerous search engines. The
most basic of these that I have seen is the one that I am trying to work
with.
Its code follows...

<head>
     <script language="JavaScript">
        var FirstForm;
           function StartSearch(){
             
document.forms[FirstForm+document.InputForm.SearchSelect.selectedIndex].elements[0].value=document.InputForm.SearchWords.value;
             
document.forms[FirstForm+document.InputForm.SearchSelect.selectedIndex].submit();
           }
     </script>
  </head>
  <body>
     <form Name="InputForm">
        Search For: <input name="SearchWords" type=text size=30>
        Search Engine: <select Name="SearchSelect">
           <option selected>Yahoo
           <option>Altavista
           <option>Excite
           <option>Lycos
        </select>
        <input type=button value="Search" onClick="StartSearch()">
     </form>

     <script
language="JavaScript">FirstForm=document.forms.length</script>

     <form action="http://search.yahoo.com/bin/search" method=get>
        <input type="hidden" size=35 name=p>
     </form>

     <form action="http://www.altavista.digital.com/cgi-bin/query"
method=get>
        <input type="hidden" name=q size=35 maxlength=200 value="">
        <input type="hidden" name=pg value=q>
        <input type="hidden" name="fmt" value=".">
        <input type="hidden" name=what value=web>
     </form>

     <form action="http://www.excite.com/search.gw" method=post>
        <input type="hidden" name="search" size=35>
        <input type="hidden" name="searchType" value="Keyword">
        <input type="hidden" name="category" value="default" checked>
        <input type="hidden" name="mode" value="relevance">
        <input type="hidden" name="showqbe" value="1">
        <input type="hidden" name="display" value="html3,hb">
     </form>

     <form
action="http://www.lycos.com/cgi-bin/nph-randurl/cgi-bin/largehostpursuit1.html">
        <input type=hidden size=35 name="query">
     </form>
  </body>

The above, as you see, only uses very limited javascript to get the job
done. For me this is fine and while this is okay I would like to be able
to use radio buttons to make the selection instead of the option box.
I am sure that this is possible but for me it has not been something I
have been able to do. Believe me, I have tried, but my limited
javascript knowledge is my downfall here.

The following is one of my atempts...

<HTML>
<head>
<SCRIPT language="JavaScript">
        var FirstForm;

        function StartSearch(form){
        for (Count = 0; Count < 4; Count++) {
                if (form.SearchSelect[Count].checked)
                        break;
                {
       
document.forms[FirstForm+document.form.SearchSelect.checked].elements[0].value=document.InputForm.SearchWords.value;
               
document.forms[FirstForm+document.form.SearchSelect.checked].submit();
                }
        }
}
</script>
</head>

<body>

<form Name="InputForm">
Search For: <input name="SearchWords" type=text size=30>
<input type=button value="Search" onClick="StartSearch(form)">
<br>
<br><br>
Search Engine:
<BR>
<INPUT TYPE="radio" NAME="SearchSelect" CHECKED onClick=0>Yahoo<BR>
<INPUT TYPE="radio" NAME="SearchSelect" onClick=0>Altavista<BR>
<INPUT TYPE="radio" NAME="SearchSelect" onClick=0>Excite<BR>
<INPUT TYPE="radio" NAME="SearchSelect" onClick=0>Lycos<BR>

</FORM>

<br></form>

    <script
language="JavaScript">FirstForm=document.forms.length</script>

    <form action="http://search.yahoo.com/bin/search" method=get>
       <input type="hidden" size=35 name=p>
    </form>

    <form action="http://www.altavista.digital.com/cgi-bin/query"
method=get>
       <input type="hidden" name=q size=35 maxlength=200 value="">
       <input type="hidden" name=pg value=q>
       <input type="hidden" name="fmt" value=".">
       <input type="hidden" name=what value=web>
    </form>

    <form action="http://www.excite.com/search.gw" method=post>
       <input type="hidden" name="search" size=35>
       <input type="hidden" name="searchType" value="Keyword">
       <input type="hidden" name="category" value="default" checked>
       <input type="hidden" name="mode" value="relevance">
       <input type="hidden" name="showqbe" value="1">
       <input type="hidden" name="display" value="html3,hb">
    </form>

    <form
action="http://www.lycos.com/cgi-bin/nph-randurl/cgi-bin/largehostpursuit1.html">
       <input type=hidden size=35 name="query">
    </form>

</BODY>

I don't know, was I on the right track with this?
I am sure that you see what I am trying to do here. Can you help me with
this? As I said, my javascript knowledge is very limited at this time,
so be as simplistic as possible in your solutions to my problem please!
If a "solution" to my problem can be given it would be greatly
appreciated.

Regards,

Owen.
owenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

moorepCommented:
why not include the url as the value of the option (give the option buttons all the same names) and then concatenate the query  to this value (with appropriate parameters) in a JavaScript function. Use a <INPUT TYPE="button" onClick="MyFunc()">
instead of a submit button.
<SCRIPT etc>
function MyFunc() {
    document.location=SearchSelect.value+"bin/query?p="+MyQuery.value;
// end func
}
</SCRIPT>
<FORM etc>
<INPUT TYPE=text NAME="MyQuery">
<INPUT TYPE="radio" NAME="SearchSelect" VALUE="http://www.yahoo.com/">YAHOO
<INPUT TYPE="radio" etc.....
<INPUT TYPE=button VALUE="Search" onClick="MyFunc()">
</FORM>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.