PHP refreshing an Iframe from another Iframe

Discussion in 'HTML & Website Design' started by moseslev, Mar 17, 2011.

  1. #1
    I have a page with several Iframes on it. In some events i have to refresh an Iframe from another Iframe. Each iframe contains an HTML (or PHP) file loaded by the Iframe definitions or by another activity.

    In one case I need to update a field in another iframe. All i tried failed.the field is within A tag. the other field (which should be changed is text field. Those two fields are whithin DIV tag. The DIV and A tags have id and name.

    is anyone knows how to do it? Pls help.

    Thanks
    Moshe Levin
     
    moseslev, Mar 17, 2011 IP
  2. moseslev

    moseslev Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    found how to do it.

    That the page lay out:

    </head>

    <div id="page">
    <div id="header">
    <iframe id="myIframe0" name="myIFrame0" height="100px" src="/xlogo.php" width="1000px" scrolling="auto"
    marginwidth="4" marginheight="8" frameborder="0" scrolling="no"></iframe>
    </div>
    <div id="header1">
    <iframe id="myIframe9" name="myIFrame9" height="36px" src="/mainMenu.php" width="1000px" scrolling="auto"
    marginwidth="1" marginheight="1" frameborder="0" scrolling="no"></iframe>
    </div>
    <div id="leftColumn" >
    <iframe id="myIframe1" name="myIFrame1" height="640px" src="/SideFrame.php?DDtopic=-1" frameborder="0" width="174px" scrolling="auto"
    marginwidth="1" marginheight="1" frameborder="0" scrolling="no"></iframe>
    </div>
    <div id="mainColumn" name="mainColumn" >
    <?php $GLOBALS['errTxt'] = '';?>
    <iframe id="myIframe2" name="myIFrame2" height="640px" src="/TVabout.php" frameborder="0" width="663px" scrolling="auto"
    marginwidth="1" marginheight="1" frameborder="0" scrolling="no" ></iframe>
    </div>
    <div id="rightColumn" >
    <iframe id="myIframe3" name="myIFrame3" height="640px" src="/RightSide.html" frameborder="0" width="100%" scrolling="auto"
    marginwidth="1" marginheight="1" frameborder="0" scrolling="no"></iframe>
    </div>
    <div id="aFooter" >
    <iframe id="myIframe4" name="myIFrame4" height="54x" src="/footer.php" frameborder="0" width="1000px" scrolling="auto"
    marginwidth="0" marginheight="0" frameborder="0" scrolling="no" bgcolor="#afeeee"></iframe>
    </div>
    </html>

    in One of the PHP pages I added:

    parent.document.getElementById("myIframe9").src = "/mainMenu.php";
    parent.document.getElementById("myIframe2").src = "/Disp_rss.php";

    and it worked.

    Thanks
     
    moseslev, Mar 17, 2011 IP
  3. Automagick

    Automagick Greenhorn

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    23
    #3
    Exactly.

    You can also do ir easily (i the iframe has the "name" attribute), this way:

    document.myIframe2.src="/mainMenu.php";

    Sounds like not much an improvement, but if you have heavy pages, it helps.
     
    Automagick, Mar 18, 2011 IP