Speaking in general, you can access the page contents embedded via IFRAME and shown inside the DHTML Window in the following way. Say you have the following to open a DHTML window:
Code:
var mywinz=dhtmlwindow.open("pagebox", "iframe", "test.htm", "My Web Page", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")
And inside test.htm, you have the below form:
Code:
<form>
<input type="text" id="myname" value="George" />
</form>
Now, on your parent page, you can alert the value of the form contained inside test.htm with the code:
Code:
<a href="#" onClick="alert(window.frames['_iframe-pagebox'].document.getElementById('myname').value); return false">Get value</a>
The key is the code:
Code:
window.frames['_iframe-pagebox']
Which is how you access from the parent page the document contained inside the DHTML Window via IFRAME. Change pagebox to match the ID of the DHTML window div when you called dhtmlwindow.open() earlier.
With this info you should also be able to access the contents of one DHTML window from another. From within WindowB, just remember to first navigate back to the parent window before constructing the rest of your code to access WinA, something like:
Code:
parent.frames['_iframe-pagebox'].document.getElementById('myname').value
Bookmarks