473,499 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

In page search option - open new window

2 New Member
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
1 2501
acoder
16,027 Recognized Expert Moderator MVP
Use window.open.
Apr 11 '07 #2

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

Similar topics

1
2598
by: Matthew Robinson | last post by:
i wrote a search page for my site (searching through a mysql database) but when i type in more than one word (eg "item three") in the search field it gets passed to the page as a single word...
4
1712
by: JP SIngh | last post by:
I have three dropdowns in one of my asp page. Each dropdown does return a huge amount of records , 5000 to be precise. The huge amount of data makes the page slower to load and also makes it...
5
3631
by: Alan | last post by:
While not rs.eof <td><%=rs("InvoiceNo")%></td> <td><%=rs("Name")%></td> <td><a href="InvoicePrint.asp?WInv=<%=rs("InvoiceNo")%>"></a></td> <td>Print this invoice</td> rs.MoveNext Wend Now...
2
1830
by: Bill S. | last post by:
Hey, I am trying to figure this out. The hyperlinks on my page open up a small popup window. I have no reason to refresh the parent page or what have you. I was living in a very happy world,...
3
8766
by: jj | last post by:
Hi NG I have a form, where I can activate the search and replace dialogbox when pressing a button. My problem is that the dialogbox opens with the default that it should search for full match...
8
2039
by: Someone | last post by:
Hi, I wish to use a dictionary.com search box and want the results of a search to open in a new window. Is there a way to do this using their code? The copy and paste code is provided below. ...
1
9320
by: colleen1980 | last post by:
Hi: Can any one please tell me that how to i pass the two textbox values in the new page. If i use the form action in the popup window page then the new page is open in the same popup window as i...
3
3267
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a...
2
2575
by: Richard | last post by:
Help please. I am trying to autofill a form text field from a select-box lookup. I have no problem doing this if the select-box is part of the form but because there are 5 possible select boxes...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5479
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.