Netscape Incompatibility

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • news.comcast.giganews.com

    Netscape Incompatibility

    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('ad vanced.html', '',
    'toolbar=0,scro llbars=0,locati on=0,statusbar= 0,menubar=0,res izable=1,width= 4
    00,height=430,l eft = 312,top = 159');
    win2.opener.nam e = "opener";

    The code in the new window for submitting the form is:
    <form name="form1" method="post"
    action="http://www.mywebsite.c om/cgi-bin/search.pl" target="opener"
    onsubmit="windo w.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


  • Mick White

    #2
    Re: Netscape Incompatibility

    news.comcast.gi ganews.com wrote:
    [color=blue]
    > 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('ad vanced.html', '',
    > 'toolbar=0,scro llbars=0,locati on=0,statusbar= 0,menubar=0,res izable=1,width= 4
    > 00,height=430,l eft = 312,top = 159');
    > win2.opener.nam e = "opener";[/color]

    win2.document.f orms[0].target=opener;
    [color=blue]
    >
    > The code in the new window for submitting the form is:
    >[/color]

    I would eliminate "window.close() "

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

    You could add target="javascr ipt:opener"

    Mick
    [color=blue]
    >
    > 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
    >
    >[/color]

    Comment

    • Lee

      #3
      Re: Netscape Incompatibility

      news.comcast.gi ganews.com said:[color=blue]
      >
      >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('ad vanced.html', '',
      >'toolbar=0,scr ollbars=0,locat ion=0,statusbar =0,menubar=0,re sizable=1,width =4
      >00,height=430, left = 312,top = 159');
      >win2.opener.na me = "opener";
      >
      >The code in the new window for submitting the form is:
      ><form name="form1" method="post"
      >action="http ://www.mywebsite.c om/cgi-bin/search.pl" target="opener"
      >onsubmit="wind ow.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.[/color]

      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.

      Comment

      • Lasse Reichstein Nielsen

        #4
        Re: Netscape Incompatibility

        "news.comcast.g iganews.com" <anon@ymous.com > writes:
        [color=blue]
        > 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.[/color]

        Ok, makes sense.
        [color=blue]
        > This works fine in IE 6, but fails in Netscape 7.[/color]
        [color=blue]
        > The code for opening the new window is:
        > win2 = window.open('ad vanced.html', '',
        > 'toolbar=0,scro llbars=0,locati on=0,statusbar= 0,menubar=0,res izable=1,width= 4
        > 00,height=430,l eft = 312,top = 159');[/color]

        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?
        [color=blue]
        > win2.opener.nam e = "opener";[/color]

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

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

        That was what I would expect.
        [color=blue]
        > Any suggestions on making this work in Netscape would be greatly
        > appreciated.[/color]

        Try delaying the window closing, e.g.,
        onsubmit="setTi meout(window.cl ose, 500);"
        (or perhaps a little safer:
        onsubmit="setTi meout(function( ){window.close( );}, 500);"
        )
        /L
        --
        Lasse Reichstein Nielsen - lrn@hotpop.com
        DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
        'Faith without judgement merely degrades the spirit divine.'

        Comment

        Working...