[英]How to disable Modal pop up box
When a button clicked it shows a modal box. 单击按钮时,将显示一个模式框。 That modal box contains two buttons.
该模式框包含两个按钮。
OK
and Cancel
button. OK
和Cancel
按钮。 When we click on the OK
button it shows an alert message box, up to this I got correctly. 当我们单击“
OK
按钮时,它将显示一个警报消息框,直到我正确为止。 But I want to disable the modal box when an alert message pop up. 但是我想在弹出警报消息时禁用模式框。 I tried lot of methods like
我尝试了很多方法,例如
$("modalFileStruct").('disabled', true);
$("#modalFileStruct").fadeOut("slow");
$("#modalFileStruct").addClass("fade");
$("#modalFileStruct").setFocusable(true)
$("#modalFileStruct").css('style','background-color: #000; opacity:1; z-index:1000;');
document.getElementById("modalFileStruct").removeAttribute("tabIndex");
$('#fileStruct').blur();
$("#modalFileStruct").css("position","relative","z-index","99");
$('#modalFileStruct').fadeIn('slow');
$('#modalFileStruct').fadeOut('slow');
But it doesn't satisfy my need. 但这不能满足我的需求。 Could anyone help me?
有人可以帮我吗?
This is my code 这是我的代码
$("#modalFileStruct").modal();//This is pop up the modal box
//This is the click function of OK button inside the modal box
function fileInfoClicked(){
alertMessage('Error',"Attribute name contains special characters: " + inps[i],
'error');
return;
}
//Code for alert message box //警报消息框的代码
function alertMessage(title, message, type) {
$.msgBox({
title : title,
content : message,
type : type,
modal : true
});
}
$("#modalFileStruct").modal();//This is pop up the modal box
//This is the click function of OK button inside the modal box
function fileInfoClicked(){
$("#modalFileStruct").modal("toggle");
}
I guess you want the user to force to click OK button instead of closing the modal when user clicks on page. 我想您希望用户在单击页面时强制单击“确定”按钮,而不是关闭模式。 by the way which plugin are you using?
顺便问一下,您在使用哪个插件? In Bootstrap use
data-backdrop="static"
在Bootstrap中使用
data-backdrop="static"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.