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
    Jul 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Passing a variable from a 2 frame popup to main page

    I have a main page lets say called main.php. In there I have a text box called manager. Next to it, I have a link where when clicked it opens a popup box.

    This popup box has two frames, top and bottom. The top one prompts the user to search for manager name. The bottom section lists down all managers. After selecting the required manager in the bottom section using radio button, there is an update button where when clicked, the record should be updated in the textbox in main.php.

    I got all to work except for the part where I cannot update the selected record back to the main page. Can someone help me?

  • #2
    New Coder
    Join Date
    Mar 2006
    Location
    São Paulo, Brazil
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Then, i think you have this situation: a main page and a popup with 2 frames, right?

    Let's suppose that the structure of your popup is something like this:
    Code:
    <html>
    <head>
    <title></title>
    </head>
    <frameset rows="50%, 50%" border="0">
      <frame src="page1.html">
      <frame src="page2.html">
    </frameset>
    </html>
    And let's suppose too that the structure of your main page is something like this:
    Code:
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <textarea id="mainText" name="mainText" rows="6" cols="60"></textarea>
    </body>
    If you want to pass text content from the "page2.html" in the popup to the main page, you can do it as the follow:
    Code:
    <script>
    //code in page2.html
    
    parent.frames.opener.document.getElementById("mainText").value = "SOME TEXT";
    
    </script>
    I've simulated here and it worked.

    I hope this can help you. And if you need some help, post again!
    ----
    As coisas mais simples são as mais importantes.
    ---------
    Thompson M1A1: D-Day
    ----------------

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks !



  •  

    Posting Permissions

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