我有一个 ASP.NET MVC 页面(注册)。在加载页面时,我在该对话框上调用带有同意和不同意按钮的 Jquery 对话框。
1)。默认情况下如何将焦点设置为“同意”按钮?
2)。如何禁用右上角的X(关闭)标记?(所以我不希望用户简单地关闭该对话框)。
代码:
$("#dialog-confirm").dialog({
closeOnEscape: false,
autoOpen: <%= ViewData["autoOpen"] %>,
height: 400,
width: 550,
modal: true,
buttons: {
'Disagree': function() {
location.href = "/";
},
'Agree': function() {
$(this).dialog('close');
$(this).focus();
}
},
beforeclose: function(event, ui) {
var i = event.target.id;
var j = 0;
}
});
感谢您的回复。
谢谢