Open a page from search frame

K

Kojak

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
 
R

Robert

Kojak said:
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 = ...
 
R

Robert

Kojak said:
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=...
 
K

Kojak

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top