Netscape Incompatibility

  • Thread starter news.comcast.giganews.com
  • Start date
N

news.comcast.giganews.com

I have a web page that pops up a new window with a form in it, then when the
user clicks the submit button in the new window, it submits to the
originating window and the new window closes.

This works fine in IE 6, but fails in Netscape 7.

The code for opening the new window is:
win2 = window.open('advanced.html', '',
'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=4
00,height=430,left = 312,top = 159');
win2.opener.name = "opener";

The code in the new window for submitting the form is:
<form name="form1" method="post"
action="http://www.mywebsite.com/cgi-bin/search.pl" target="opener"
onsubmit="window.close()">

In Netscape, the new window closes, but the form is not submitted to the
original window.

Any suggestions on making this work in Netscape would be greatly
appreciated.

Thank You,
Corey Martin
 
M

Mick White

news.comcast.giganews.com said:
I have a web page that pops up a new window with a form in it, then when the
user clicks the submit button in the new window, it submits to the
originating window and the new window closes.

This works fine in IE 6, but fails in Netscape 7.

The code for opening the new window is:
win2 = window.open('advanced.html', '',
'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=4
00,height=430,left = 312,top = 159');
win2.opener.name = "opener";
win2.document.forms[0].target=opener;


The code in the new window for submitting the form is:

I would eliminate "window.close()"

<form name="form1" method="post"
action="http://www.mywebsite.com/cgi-bin/search.pl">

You could add target="javascript:eek:pener"

Mick
 
L

Lee

news.comcast.giganews.com said:
I have a web page that pops up a new window with a form in it, then when the
user clicks the submit button in the new window, it submits to the
originating window and the new window closes.

This works fine in IE 6, but fails in Netscape 7.

The code for opening the new window is:
win2 = window.open('advanced.html', '',
'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=4
00,height=430,left = 312,top = 159');
win2.opener.name = "opener";

The code in the new window for submitting the form is:
<form name="form1" method="post"
action="http://www.mywebsite.com/cgi-bin/search.pl" target="opener"
onsubmit="window.close()">

In Netscape, the new window closes, but the form is not submitted to the
original window.

Any suggestions on making this work in Netscape would be greatly
appreciated.

It works in Netscape if you eliminate the onsubmit handler.
Just as it should, the onsubmit handler executes *before*
the form is submitted. The window closes immediately with
nothing submitted.
 
L

Lasse Reichstein Nielsen

news.comcast.giganews.com said:
I have a web page that pops up a new window with a form in it, then when the
user clicks the submit button in the new window, it submits to the
originating window and the new window closes.

Ok, makes sense.
This works fine in IE 6, but fails in Netscape 7.
The code for opening the new window is:
win2 = window.open('advanced.html', '',
'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=4
00,height=430,left = 312,top = 159');

Avoid posting lines longer than ~72 characters. Your client broke the
above line. In this case it is obvious, but in other cases it can introduce
more subtle errors.

Remove spaces in third argument to window.open. Some browsers choke on
them (not Netscape 7 though, so that's not the problem).

It's not necessary to have the propertie with "=0" in the third argument.
The default is "off" if they are not present, so only put in the ones with
"=1".

Should "win2" be a global variable, or have you declared it local in some
other part of the code?
win2.opener.name = "opener";

That should be the same as
window.name = "opener";
That's also safer
The code in the new window for submitting the form is:
<form name="form1" method="post"
action="http://www.mywebsite.com/cgi-bin/search.pl" target="opener"
onsubmit="window.close()">

The onsubmit handler is executed *before* the form is submitted. I am
amazed that it works in IE.
In Netscape, the new window closes, but the form is not submitted to the
original window.

That was what I would expect.
Any suggestions on making this work in Netscape would be greatly
appreciated.

Try delaying the window closing, e.g.,
onsubmit="setTimeout(window.close, 500);"
(or perhaps a little safer:
onsubmit="setTimeout(function(){window.close();}, 500);"
)
/L
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top