Fortunately there is a workaround.
First the modal window:
When closing the modal window it is not enough to set the window.returnValue to the specified return value. Instead, check for the window.opener and set the returnValue there as well:
Then the window calling the modal window:
To receive the return value from the modal window you need to do this:
window.returnValue = undefined; var result = window.showModalDialog("modalwindow.aspx", window, "dialogHeight:650px; dialogWidth:900px;"); if (result == undefined) result = window.returnValue; if (result != null && result != "undefined") // Do something with the return value // defined in "result"
This has beed tested in IE9 and Google Chrome 21.0.1180.83 m. According to other sources it will work in later Firefox versions as well.
- showModalDialog fails to return window.returnValue after being submitted from a form (asp based project) ning value in Chrome from Chromium bug report system.