开发者

jquery: the parent modal dialog textbox is not editable

jquery ui.dialog after open a modal dialog, if I will open another modal dialog again and close it, the textbox is lock in the parent dialog. I can not resolve this problem. if I open a non-modal dialog , it works fine, but the parent dialog can be closed ,How to resolve it , thanks , waiting online

html:(dotnet mvc2)

<input id="btnDlg" type="button" value="open dialog"/>
<div id="dlg1"><%=Html.TextBox("txtName","can not edit") %><input id="btnShowDlg" type="button" value="dialog again" /></div>
<div id="dlg2"><div>the second dialog</div><%=Html.TextBox("txtName2") %></div>

jquery:

//first modal dialog
$("#dlg1").dialog({
                autoOpen: false,
                height: 350,
                width: 300,
                title: "The first dialog!",
                bgiframe: true,
                modal: true,
                resizable: false,
                buttons: {
                    'Cancel': function() {
                        $(this).dialog('close');
                    },
                    'OK': function() {
                        $(this).dialog('close');
                    }
                }
            })
//second modal dialog
            $("#dlg2").dialog({
                autoOpen: false,
                height: 200,
                width: 300,
                title: "This is the second dialog!",
                bgiframe: true,
                modal: true,
                resizable: false,
                buttons: {
                    'Cancel': function() {
                        $(this).dialog('close');
                    },
                    'OK': function() {
                        $(this).dialog('close');
                    }
                }
            })
//show the first modal dialog
            $("#btnDlg").click(function() {
                $("#dlg1").dialog("open");
            })
    //show the second modal dialog
                $("#btnShowDlg").click(function() {
                    $("#dlg1").dialog("options", "hide",true);
  开发者_开发问答                  $("#

dlg2").dialog("open");
            })


I just figured it out, just in case sb ever needs an answer and doesn't find one

One needs to change the z-index in CSS file of #btnShowDlg to this (not exactly)# 638746and then the fields within the modal preview are editable.. No need to change anything else :)

Just go to your css file, locate #btnShowDlg and either change or set z-index:638746;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜