我有一个ASP.NET MVC页面(注册).在加载页面时,我在该对话框上使用“同意”和“不同意”按钮调用Jquery Dialog.
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;
}
});
感谢您的回复.
谢谢
最佳答案
我用这个:
$("#dialog-confirm").dialog({
open: function(event,ui) {
$(".ui-dialog-titlebar-close").hide(); // Hide the [x] button
$(":button:contains('Ok')").focus(); // Set focus to the [Ok] button
}
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。