SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    bahrain
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up parent child windows

    HI
    I have a page ('testPage') and i am opening a pop up from this page.
    on the pop up page i have one frame and inside the frame i am trying to get one form value from 'testPage'.

    i am doing this
    window.opener.parent.document.forms['myform'].fieldname.value;

    this is workin ok in firefox but in IE7 it is giving me this error
    "window.opener.parent is null or not an object"
    ????
    its urgent plzzz.....
    regards
    phphelp

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    looks like it should be

    window.parent.opener

  3. #3
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    bahrain
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not working. with this it is not working even in firefox.
    its urgent plzzz.....
    regards
    phphelp

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should work fine. Create these test files and try it:

    start.html
    Code:
    <html>
    <body>
    <button onclick="window.open('popup.html');return false;">open popup</button>
    <form name="myform">
    <input type="text" name="myfield" value="this is the value" />	
    </form>
    </body>
    </html>
    popup.html
    Code:
    <html>
    <body>
    text
    <iframe src="frame.html"></iframe>
    </html>
    frame.html
    Code:
    <html>
    <body>
    <button onclick="document.getElementById('here').innerHTML = window.parent.opener.document.myform.myfield.value;return false;">click me</button>
    <div id="here"></div>
    </body>
    </html>


Bookmarks

Posting Permissions

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