Post parameters to a frame of new window

Posted by st.stoqnov on Stack Overflow See other posts from Stack Overflow or by st.stoqnov
Published on 2010-03-12T22:04:37Z Indexed on 2010/03/12 22:07 UTC
Read the original article Hit count: 203

Filed under:
|

I have to modify an existing web search page. There is a page, where all the search filters are (form with name "searchform"). When the search button is pressed, results are shown in new window. Because the search takes up to 30 seconds, and while searching the window stays blank, I have to add a label "Searching. Please wait..." at the new created window with the results.

So the search window is created, and I set it's location to a frameset. First frame will show the label, and the second will show the results. But i can't manage to update the second frame with the results.

Result windows is created as:

var left = (screen.width/2) - 750/2;
var top = (screen.height/2) - 600/2-100;
var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=750,height=600,left='+left+',top='+top+',screenX='+left+',screenY='+top;

var msgWindow = window.open('ex_search_frameset.php', 'results_exi', styleStr);
msgWindow.focus();

Than the search is requested:

f = document.searchform;
f.action = 'ex_search_results.php';
f.target = msgWindow.document.res_frame; // here i can't figure out what the target 

must be // or how to post the params from "f" to the second frame "res_frame" f.submit();

Here is the frameset.

<frameset rows="200,*" border="1" name="SearchFrame">
   <frame name="wait_frame" src="ex_search_wait.php" target="right">
   <frame name="res_frame" src="ex_search_results.php" target="_self">
</frameset>

Any idea how to do this?

© Stack Overflow or respective owner

Related posts about html

Related posts about frame