Click to See Complete Forum and Search --> : Help, please!:)


ksenya
03-11-2003, 03:19 AM
Hi everyone!:) I have some problem with opening a Search page in a new (_Blank) window form the frame window. I have this script for search and it works, but it opens the search window in the same frame window. It's awful!:)

function startSearch(){searchString = document.searchForm.searchText.value;if(searchString != ""){searchEngine = document.searchForm.whichEngine.selectedIndex + 1;finalSearchString = "";

if(searchEngine == 1){finalSearchString = "http://www.geocities.com/mySite/mysite.htm";}
if(searchEngine == 6){finalSearchString = "http://www.google.com/search?q=" + searchString + "&btnG=Google+Search";}
if(searchEngine == 7){finalSearchString = "http://www.icyspicy.com/cgi-bin/search/search.cgi?keywords=" + searchString;}

and so on...


This what I have in HTML
<form name="searchForm"><br>
<p > find
<input name="searchText" type="text" /> with
<select name="whichEngine" onchange="startSearch()" >
<option selected>Select</option>
<option>Google</option>
<option>IcySpicy</option>
</select>
</p>
</form>

Do I need to change something in the script above to make it works properly?
Thanks in advance!:)

khalidali63
03-11-2003, 03:24 AM
Add target="_blank"
in this line
<form name="searchForm">
,it would look lke this

<form name="searchForm" target="_blank">

This hsould do the trick.

Cheers

Khalid

khalidali63
03-11-2003, 03:49 AM
Did the above suggestion work for you??

Khalid

ksenya
03-11-2003, 04:18 AM
It's sad this suggestion doesn't work!:(
I've done as you said
<form name="searchForm" target="_blank" >

But when I click the Search a new page opens in the same frame window! :eek:

Do you have any other advices?;)

gil davis
03-11-2003, 05:54 AM
and so on...I believe that you will find somewhere in the part you neglected to post a statement similar to this:window.location = finalSearchString;Change it to:window.open(finalSearchString);

ksenya
03-11-2003, 11:24 AM
Unbelievable! So siple!:)
Thanks, Gil Davis !:) It works!:)