IE is not redirecting the output to the correct frame

M

Magesh

Hi,

I am trying to do the following

1. On form submit, open a window with three frames
2. Set the target as one of the frames
3. Set the action for the frame

It is working properly in version 6.0.2800.1106.xpsp2, etc. But, the
same page is not working properly in version 6.0.2800.1006CO. IE
opens two windows, one window containing the Frames and another window
which contains the output of test1.html.

I have attached the two files:

test.html
=========

<html>
<head>
<script language='javascript'>
function doit(form)
{
var tmpStr = "<HTML> <HEAD><TITLE>iView Record
Detail</TITLE></HEAD>" +
"<FRAMESET ROWS='30,100,30'> " +
"<FRAME ID='detailDisplayHeader' SRC='' MARGINHEIGHT=0
MARGINWIDTH=0 NORESIZE>"+
" <FRAME ID='detailDisplayBody' NAME='bodyname'
MARGINHEIGHT=0 MARGINWIDTH=0>" +
" <FRAME ID='detailDisplayFooter' SRC='' MARGINHEIGHT=0
MARGINWIDTH=0 NORESIZE>" +
" </FRAMESET>" +
"</HTML> ";

var mywindow=window.open('','myname'
,'toolbar=0,location=0,directories=0,status=1,menubar=0,width=500,height=600,scrollbars=1,resizable=1,left=100,Top=100');
mywindow.document.write(tmpStr);
mywindow.document.close();

form.target='bodyname';
form.action='test1.html';
mywindow.focus();

form.submit();
}
</script>
</head>
<body>Hello!!!
<form name="myform" onsubmit='doit(this); return false;'>
<input name='S' type='submit' value='button' />
</form>

</body>
</html>

2. test1.html
=============
<HTML>
<body>
HELLO
</body>
</HTML>

Any help in resolving this issue is greatly appreciated.
Magesh.
 
G

Grant Wagner

Magesh said:
Hi,

I am trying to do the following

1. On form submit, open a window with three frames
2. Set the target as one of the frames
3. Set the action for the frame

It is working properly in version 6.0.2800.1106.xpsp2, etc. But, the
same page is not working properly in version 6.0.2800.1006CO. IE
opens two windows, one window containing the Frames and another window
which contains the output of test1.html.

I have attached the two files:

test.html
=========

<html>
<head>
<script language='javascript'>

function doit(form)
{
var tmpStr = "<HTML> <HEAD><TITLE>iView Record
Detail</TITLE></HEAD>" +
"<FRAMESET ROWS='30,100,30'> " +
"<FRAME ID='detailDisplayHeader' SRC='' MARGINHEIGHT=0
MARGINWIDTH=0 NORESIZE>"+
" <FRAME ID='detailDisplayBody' NAME='bodyname'
MARGINHEIGHT=0 MARGINWIDTH=0>" +
" <FRAME ID='detailDisplayFooter' SRC='' MARGINHEIGHT=0
MARGINWIDTH=0 NORESIZE>" +
" </FRAMESET>" +
"</HTML> ";

var mywindow=window.open('','myname'
,'toolbar=0,location=0,directories=0,status=1,menubar=0,width=500,height=600,scrollbars=1,resizable=1,left=100,Top=100');
mywindow.document.write(tmpStr);

You are attempting to write to the document of a newly opened window milliseconds after you've asked the browser to open it.
There is no guarantee that the new window will contain a document available for writing to. You'd be much better off with:

<script type="text/javascript">
var output = "Your HTML...";
function doit(f) {
var mywindow = window.open('javascript:window.opener.output', 'myname', '...');
return true;
}
</script>

And since the whole function is being set by the onsubmit event of the form, why not define your target and action in the
<form> tag:

<form target="bodyname" action="test1.html" onsubmit="return doit(this);">
 
G

Garry

We had the same problem. There is a bug introduced if you forget to
apply Q832894 to IE. The symptoms of the problem are that if you try
to reuse an already open window or frame that has a name assigned to
it, IE will ignore it and open a new window if you target it or use
window.open( url, name ). Read the support document for security
update 867801, which states that it is for everything AFTER 832894.
Sorry for not giving a longer explanation, but I replied to Magesh and
thought it would post a follow up here too.

This combination works:
IE 6.0.2800.1106CO SP1; Q832894; Q871260; Q833989

Cheers.
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top