我有两个引导箱模式窗口 - 一个是提示,另一个是警报。如果用户输入错误的数据并尝试提交,则会出现另一个引导框警报。用户点击确定后,再次调用提示。问题是第二次警报被称为第二次的提示覆盖。是否可以防止提示(称为第二次)覆盖警报?http://bootboxjs.com/v3.x/documentation.html中似乎没有任何内容。
我的代码:
bootbox.prompt("what's your name?", "No", "yes", function(result) {
if (result != null) {
if(result.trim() == ""){
bootbox.alert("The name cannot be empty.");
}else{
bootbox.alert("Supplier name can only be 15 characters long.");
supplierPrompt(location);
}
}
}, "Default name eg S1");
编辑:警报后,再次调用提示。第二次调用提示时,它会阻止警报。