admin管理员组

文章数量:1323200

I am working on a Web Application that uses many modal dialogs to take inputs. The issue started when I started making the app patible with IE11 (it works perfectly fine in IE8). The Modal Dialog boxes return values perfectly when when called from the main page, but when I create a Modal Dialog from a Modal Dialog, the value is returned but is not caught and is taken as undefined.

//calling the values
var ret = ShowDialogOpen(pageUrl, width, height);

function ShowDialogOpen(PageName, strWidth, strHeight) {
    var DialogOptions = "Center=Yes; Scrollbar=No; dialogWidth=" + strWidth + ";          dialogTop=150px; dialogHeight=" + strHeight + "; Help=No; Status=No; Resizable=Yes;";
    var OpenUrl = PageName; 
    var ret = window.showModalDialog(OpenUrl, "Yes", DialogOptions);
		    
    return ret;
}

//Dialog returning values
function ReturnValues() {
    var lstBox = document.getElementById("lst_Name");
    var texts = "";
    var values = "";
    for (i=0; i<lstBox.options.length; i++) {
        texts = texts + lstBox.options[i].text + "!";
        values = values + lstBox.options[i].value + "!";
    }

    window.returnValue = texts + "$" + values;
    Close();
    return false;
}

I am working on a Web Application that uses many modal dialogs to take inputs. The issue started when I started making the app patible with IE11 (it works perfectly fine in IE8). The Modal Dialog boxes return values perfectly when when called from the main page, but when I create a Modal Dialog from a Modal Dialog, the value is returned but is not caught and is taken as undefined.

//calling the values
var ret = ShowDialogOpen(pageUrl, width, height);

function ShowDialogOpen(PageName, strWidth, strHeight) {
    var DialogOptions = "Center=Yes; Scrollbar=No; dialogWidth=" + strWidth + ";          dialogTop=150px; dialogHeight=" + strHeight + "; Help=No; Status=No; Resizable=Yes;";
    var OpenUrl = PageName; 
    var ret = window.showModalDialog(OpenUrl, "Yes", DialogOptions);
		    
    return ret;
}

//Dialog returning values
function ReturnValues() {
    var lstBox = document.getElementById("lst_Name");
    var texts = "";
    var values = "";
    for (i=0; i<lstBox.options.length; i++) {
        texts = texts + lstBox.options[i].text + "!";
        values = values + lstBox.options[i].value + "!";
    }

    window.returnValue = texts + "$" + values;
    Close();
    return false;
}

This code works perfectly when used via main-page, but when I use it from a Modal Dialog page the returnValue is lost.

Share Improve this question edited Dec 17, 2014 at 23:18 Sampson 269k76 gold badges545 silver badges568 bronze badges asked Dec 15, 2014 at 7:26 Mujtaba KablyMujtaba Kably 7558 silver badges24 bronze badges 1
  • Close(); is function – Mujtaba Kably Commented Dec 15, 2014 at 7:33
Add a ment  | 

1 Answer 1

Reset to default 6

This is a bug in a Security patch released by MS recently: http://blogs.msdn./b/ie/archive/2014/12/09/december-2014-internet-explorer-security-updates-amp-disabling-ssl-3-0-fallback.aspx

本文标签: javascriptie11 issues with Nested showModalDialogStack Overflow