"a from to send a query to an engine" 2
by "MC B" <mc_b2(at)hotmail.com>
|
Date: |
Sun, 06 Feb 2000 16:57:32 GMT |
To: |
hwg-basics(at)hwg.org |
|
todo: View
Thread,
Original
|
|
Hi
I've left a bit behind with my email, but I want to thank, though so late,
Bill (youngwilliam325@aol) and Andrew Zeiter for promptly giving their
suggestion about my question.
Here I go with the second part of it:
I want to create a form which lets the users choose the search engine they
want for submitting a query from our pages.
The form has an input box for the users to type in their query; then there
is a set of radios each corresponding to a different search engine: the user
type their query in, select the radio correspong to the engine they want and
after submitting, they get a new window with the results.
Here is the html code:
<.form name=SearchForm onsubmit="Search()">
<.input type=text name=InputBox>
<.input type=radio name=SEOpt value"1st_Engine_URL">
...
<.input type=radio name=SEOpt value"Xth_Engine_URL">
<.input type=submit>
<./form>
And the structure of the javascript function - say - Search() to manage it
as I thoughi it should be:
1. Search() reads the input and if needed substitutes spaces wih +'s;
2. determines which engine was selected and creates a variable CGIUrl whose
value is the engine's url;
3. completes the url to be called by adding to CGIUrl the input and any
other hidden value requested;
4. returns the value thus created in a variable called FinalUrl;
5. opens a new window for teh results:
Results = window.open(FinalUrl,'ResWin');
I am sure that what I want to do (hope I explained it clear enough) is
possible, because I saw it done time ago; unfortunately, I can't retrieve
the url of the page.
May the ones of you who are more familiar with javascript than me tell me
what they think about the function?
Of course, if anyone has any other commentary about my post, I'll be glad to
hear of them.
Thanks in advance.
Cris
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
HTML: hwg-basics mailing list archives,
maintained by Webmasters @ IWA