Okay so I know the question reads like I'm yet another person who doesn't know how document.ready works, but this is a bit different.
Basically I'm upgrading an old web forms application that depends on a lot of proprietary IE javascript to something that will work cross platform. One of the changes is migrating from IE's openModalDialog's function to jQuery UI's modal dialogs.
This means I'm on a web page, in an iframe, clicking on a button that triggers "window.open" on another web page that lets a user choose options. When the user chooses an option, the index changed event fires, populating hidden text boxes in the dialog. The contents of these text boxes are supposed to be passed back to "window.opener" and into text boxes on that page.
My problem is that the code that passes these values back to the opener runs before these text boxes are on the DOM, but after the rest of the content in this page has been loaded. This seems to happen even when I use RegisterClientScriptBlock to put the javascript down the bottom of the page, after everything has loaded.
Questions:
- When I am using window.opener, and the opener is in an iframe, is the opener the iframe or the document that has opened the iFrame? I think it is the former but I'm not sure
- How do I wait until after the text boxes have been populated before returning their values to the opener?
- Becuase I'm just passing values back to the opener, is there a better way of doing this? The code behind on the index changed function is just pulling text from the database, to be plugged into those text boxes.
Any help would be great.