By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,967 Members | 1,740 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,967 IT Pros & Developers. It's quick & easy.

In page search option - open new window

P: 2
Hello,

I am trying to build a search form with several different options to choose from. Currently it is set up to open within the same window if a single option is selected and open within a frameset if the "ALL" option is selected.

Is there anyway to get the results to open in new windows?

So if the user were to select the "ALL" option, is it possible to open 3 new windows with each result displaying?

Here is my code:

<script language="JavaScript" type="text/javascript">

function DoSearch() {
var Flag = 0;

if (document.ToolBox.SearchOption[0].checked==true) {
var Flag = 1;
var Engine = document.ToolBox.SearchOption[0].value;
var Query = document.ToolBox.SearchBox.value;
var locName = "http://search.info.apple.com/?search=Go&lr=lang_en&kword=&type=&newstype=&q=";
if (Query == "") {
alert("Please enter a search term");
return;
}
location.href = (locName + Query)
}

if (document.ToolBox.SearchOption[1].checked==true) {
var Flag = 1;
var Engine = document.ToolBox.SearchOption[1].value;
var Query = document.ToolBox.SearchBox.value;
var locName = "http://appletricks.com/forum/search.php?val=";
if (Query == "") {
alert("Please enter a search term");
return;
}
location.href = (locName + Query)
}

if (document.ToolBox.SearchOption[2].checked==true) {
var Flag = 1;
var Engine = document.ToolBox.SearchOption[1].value;
var Query = document.ToolBox.SearchBox.value;
var locName = "http://discussions.apple.com/search.jspa?search=Go&q=";
if (Query == "") {
alert("Please enter a search term");
return;
}
location.href = (locName + Query)
}

if (document.ToolBox.SearchOption[3].checked==true) {
var Flag = 1;
var Engine = document.ToolBox.SearchOption[2].value;
var Query = document.ToolBox.SearchBox.value;
if (Query == "") {
alert("Please enter a search term");
return;
}

var searchPage = "<HTML>";
searchPage += "\n";
searchPage += "<FRAMESET ROW=\"100%,100%,100%\">";
searchPage += "\n";
searchPage += "<FRAME SRC=\"http://search.info.apple.com/?search=Go&lr=lang_en&kword=&type=&newstype=&q=" + Query + "\">";
searchPage += "\n";
searchPage += "<FRAME SRC=\"http://appletricks.com/forum/search.php?val=" + Query + "\">";
searchPage += "\n";
searchPage += "\n";
searchPage += "<FRAME SRC=\"http://discussions.apple.com/search.jspa?search=Go&q=" + Query + "\">";
searchPage += "</FRAMESET>";
searchPage += "\n";
searchPage += "</HTML>";
document.write(searchPage);
}

</script>


<form name="ToolBox" style="line-height: 2em;">
Enter search term(s): <input type="text" name="SearchBox" size="22">
<br>
<input type="radio" name="SearchOption" value="kbase">Knowledge Base
<br / >
<input type="radio" name="SearchOption" value="idf">Internal Discussion Forum
<br / >
<input type="radio" name="SearchOption" value="cdf"> Consumer Discussion Forum
<br / >
<input type="radio" name="SearchOption" value="all"> All
<br / >
<button type="button" onclick="DoSearch();">Search</button>
</form>

Thanks in advance.

Cglewis03
Apr 9 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Use window.open.
Apr 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.