Results from child window submit into parent window, then child closes -- How To?

Discussion in 'Javascript' started by Spammay Blockay, Feb 4, 2005.

  1. Hi all...

    I'm writing a Struts application, and one window pops up another,
    non-modal, window.

    What I want to do is, when the user presses a button on the child
    window, I want the parent window to be the target of the server response.
    And I also want the child window to close.

    These windows are not frames, but fully-fledged browser windows.

    Is there a relatively easy way to do this, does anyone know?

    - Tim

    --
    Spammay Blockay, Feb 4, 2005
    #1
    1. Advertising

  2. Spammay Blockay wrote:

    > What I want to do is, when the user presses a button on the child
    > window, I want the parent window to be the target of the server
    > response.


    If that "button" is a link, use

    <a href="..." onclick="if (opener && !opener.closed) {
    opener.location=this.href; return false }"
    >...</a>


    If that "button" is a submit control, use

    <form ... onsubmit="if (opener && !opener.closed) {
    var s = "w" + new Date().getTime();
    opener.name = s; this.target = s; }"
    >


    > And I also want the child window to close.


    Try to add "window.setTimeout('close()',100);" before the "return
    false" above or after the "this.target = s;" above.

    ciao, dhgm
    Dietmar Meier, Feb 4, 2005
    #2
    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. Craig L
    Replies:
    0
    Views:
    1,739
    Craig L
    Jan 3, 2004
  2. Replies:
    0
    Views:
    253
  3. Noel Dolan
    Replies:
    0
    Views:
    206
    Noel Dolan
    Jul 18, 2004
  4. John Dalberg
    Replies:
    2
    Views:
    183
    John Dalberg
    Mar 18, 2005
  5. Bitswapper
    Replies:
    5
    Views:
    110
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page