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

Open a page from search frame

P: n/a
I have a own search engine in a intranet. It can be opened by the
search button or with the target="_search".

On the page is a Textbox and a button. The page works well, but just
opens in the wrong frame. I know the frame name I have to use is
"_main" but I dont know how to use it with Javascript.

function search( strKey ) {
var strSearch= document.forms(0).txtSearch.value;
document ??? .location.href='ViewPage.aspx?SrchKey=' + strKey +
'&SrchString=' + strSearch ;
event.returnValue = false;
}

Thanks for help
Kojak

Sep 9 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Kojak wrote:
I have a own search engine in a intranet. It can be opened by the
search button or with the target="_search".

On the page is a Textbox and a button. The page works well, but just
opens in the wrong frame. I know the frame name I have to use is
"_main" but I dont know how to use it with Javascript.


window.frames["_main"].location.href = ...
Sep 9 '05 #2

P: n/a
Hm thanks, but it's worse as I thought.

That's the way I open the Page in the search frame.
<a href="http://myPage.com/search/left.aspx" target="_search">Open in
_SearchFrame</a>

And I can open a Link in the "_main" frame
<a href="http://myPage.com/search/index.aspx" target="_main">Intranet
Suche _Main</a>

But I get an error with
window.frames["main"].location.href='NewSearchQuery.aspx'; or
...frames["_main" ]....

Does that

Sep 12 '05 #3

P: n/a
Kojak wrote:
Hm thanks, but it's worse as I thought.

That's the way I open the Page in the search frame.
<a href="http://myPage.com/search/left.aspx" target="_search">Open in
_SearchFrame</a>

And I can open a Link in the "_main" frame
<a href="http://myPage.com/search/index.aspx" target="_main">Intranet
Suche _Main</a>

But I get an error with
window.frames["main"].location.href='NewSearchQuery.aspx'; or
..frames["_main" ]....


Well I cannot see from your information which frame is in what other
frame. Perhaps the _main frame and _search frame are part of one top
frame? In that case try:
window.top.frames["_main"].location.href=...
Sep 12 '05 #4

P: n/a
My problem is I use the IE Standard Button Search for an own search.
Insead of MSN comes my search site.
is like to use a hyperlink with target="_search". Will open in a
special frame on the left site. When click a button the request should
open in the main frame which is called _main, I tried with normal links
an diffrent target. Only target="_main" opens where I expect it.
But because I want to open another Page in another frame I have to send
to another page with a query string. The best way should be javascript,
but javascript doesn't work with "_main" or "main" I tried the same
script with top or parent and is no problem, except that they opens in
the wrong frame :-(
<input type="submit" name="btnSearch" value="Go" id="btnSearch"
onClick="javascript:search( );" />

<script language="javascript">
<!--
function search( ) {
var strSearch= document.forms(0).txtSearch.value;
window.frames["_main"].location.href='SearchQuery.aspx?SrchString=' +
strSearch ;
}
//-->

maybe there is a javascript for the activ window or something?

Sep 13 '05 #5

P: n/a
It's ok now, I found a solution, it works with open( link, target );

open( "http://www.google.com", "_main");

Thanks for help.

Sep 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.