Results 1 to 2 of 2

Thread: How can I refresh the IFRAME

  1. #1

    Thread Starter
    Addicted Member wernerh's Avatar
    Join Date
    Sep 2000
    Posts
    170

    Question

    How can I refresh a IFRAME.
    What I am trying to do is to have a drop down box(<SELECT>) on a page, with a With a <IFRAME> directly below it.
    On the ONCHANGE event of the drop down box, I want to reload the page in the IFRAME, so that it dynamically updates according to the selected item in the drop down box?

    Or any other ideas on how to dynamically change fields on a page, that is read from a database according to a selection of a drop down box?

    Frustrated!!!!

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    This will work, but then you get into the cross frame security/scripting issue once you navigate to a different page. This would work fine when all of the pages are on the same server (probably), but you can't access the document when its not part of the same site, therefore you cannot replace its contents.....

    Code:
    <html>
    <body>
    
    <select id="cboURL" onchange="frmIFrame.document.location.replace(cboURL.value);">
    	<option value="http://www.microsoft.com">Microsoft.com
    	<option value="http://www.vbforums.com">VB Forums
    	<option value="http://www.netscape.com">Netscape.com
    </select>
    
    <iframe id="frmIFrame" src="about:blank"></iframe>
    
    </body>
    </html>

Posting Permissions

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



Click Here to Expand Forum to Full Width