[英]Button focus on JQuery Dialog doesn't work when showing from code behind the page - asp.net / c#
我从后面的代码中调用了confirmDialog方法,该方法工作正常,但由于某些原因,焦点未设置在取消按钮上。 当我单击弹出窗口外的模态灰色区域时,设置焦点。
有没有办法在不点击页面的情况下将默认焦点设置在取消按钮上?
对话框打开后
鼠标点击灰色区域后;
这是代码;
function confirmDialog() {
$("#dialog-confirm").html("some message here");
$("#dialog-confirm").dialog({
autoOpen: false,
resizable: false,
height: "auto",
width: "auto",
modal: true,
title: 'Warning!',
buttons: {
"Ok": function() {
$(this).dialog("close");
return true;
},
Cancel: function() {
$(this).dialog("close");
return false;
}
},
open: function() {
$(this).siblings('.ui-dialog-buttonpane').find("button:contains('Cancel')").focus();
}
});
return false;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.