FireFox thinks opener is framset window???

Discussion in 'Javascript' started by Eetu Pikkarainen, Feb 21, 2006.

  1. I have a kind of a forum system (in https://wwwedu.oulu.fi/iforum/ if you
    want to have a general look), where in main window is three frames.
    In a certain situation there is a form (named "suorlom") one frame (say
    work_frame) .
    If a users selects to save the form data as ready, then users' password
    must be checked and the form opens a popup window with another little form
    (named "pwform") with password field (named "pw").
    This popup form should write the password to the original form (to field
    named "password1").

    This works perfectly with IE and Opera, but with FireFox there are
    problems:
    When popup form is doing this:

    opener.suorlom.password1.value = pwform.pw.value;

    FireFox JavaScript console claims that:

    Error: opener.suorlom has no properties
    Source File: https://wwwedu.oulu.fi/iforum/index.ihtml
    Line: 1

    If you click the above URL in console, FireFox opens the source code of
    the main window containing just the frameset! (although the URL is not
    exactly the same as the main windows URL. ???)

    Here are relevant parts of the scripts:

    In "suorlom":
    <SELECT NAME="ready" onChange="passw(this.selectedIndex, this.form)">

    In the end of "suorlom" page:
    <script type="text/javascript">
    function passw (f,s) {
    if (f == 1) {
    win=window.open('','help','width=200,height=200, resizable,
    scrollbars')
    with (win) {
    document.open();
    document.clear();
    document.writeln(' ');
    document.writeln('<html><head><title>Tarkistus</title>');
    document.writeln('</head><body
    onload="document.pwform.pw.focus();">');
    document.writeln('<form
    action="javascript:eek:pener.suorlom.password1.value = pwform.pw.value;
    window.close();" name="pwform" onsubmit="opener.suorlom.password1.value =
    pwform.pw.value; window.close(); return false;">');
    document.writeln('<b>K&auml;ytt&auml;j&auml;n tarkistus</b><br>');
    document.writeln('Anna salasanasi: <input type="password" name="pw"
    value="" maxlength="10" size="10"><br>');
    document.writeln('<INPUT TYPE="button" VALUE=" OK "
    onClick="opener.suorlom.password1.value = pwform.pw.value;
    window.close();"><br>');
    document.writeln('<input type="button" value="Peru"
    onClick="window.close()">');
    document.writeln('</form>');
    document.write('</body></html>');
    document.bgColor = 'silver'
    document.close();
    focus();
    }
    }
    }
    </script>

    I tried to use "s.suorlom.password1.value" instead of
    "opener.suorlom.password1.value"
    but then error was "s is not defined" (Source File the same).

    Am I doing something wrong, or is this FireFox bug? And how Can I work
    around it?
    Thank you very much!
    eetu
     
    Eetu Pikkarainen, Feb 21, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Bewley via DotNetMonster.com

    window to window communication (window.opener)

    Andrew Bewley via DotNetMonster.com, Feb 3, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,055
    Andrew Bewley via DotNetMonster.com
    Feb 3, 2005
  2. Urs Gubler
    Replies:
    0
    Views:
    155
    Urs Gubler
    Jul 2, 2003
  3. Yaron C.

    opener.opener ?

    Yaron C., Oct 30, 2003, in forum: Javascript
    Replies:
    4
    Views:
    213
    Yaron C.
    Nov 2, 2003
  4. atlas
    Replies:
    1
    Views:
    135
    Martin Honnen
    Sep 7, 2005
  5. window.opener, form.opener?

    , Jul 14, 2006, in forum: Javascript
    Replies:
    5
    Views:
    283
Loading...

Share This Page