Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    get data from child window.

    Any function call to receive return value/data from a child window to its parent window.

    Thanks in advance.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Use the opener object to get the handle of the window object of the main window from the popup window.
    Code:
    if (opener && !opener.closed){
      var s = opener.document.forms[0].theField.value;
      alert(s);
    }
    If the other way around.
    Code:
    w = window.open('popup.htm');
    then somewhere in the code...
    Code:
    if (w && !w.closed){
      var s = w.document.forms[0].thePopupField.value;
      alert(s);
    }
    If this is not what you want, then please describe your problem in more detail.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New Coder
    Join Date
    Feb 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's exactly what I needed.
    Thank you so much.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •