我只使用基本的确认消息,但没有显示消息。
bootbox.confirm("Are you sure?", "No", "Yes", function(result) {
alert("test");
});
答案 0 :(得分:0)
您可以使用Custom dialog:
bootbox.dialog({
message:"Are you sure?",
buttons: {
yes: { //Button Yes
label: "Yes",
className: "btn-success",
callback: function(result) { //Do whatever you want here
alert("test");
}
},
no: { //Button No
label: "No",
className: "btn-danger",
callback: function() {}
}
}
});
在这里工作Fiddle! :)
答案 1 :(得分:0)
<script>
$('#form').submit(function (e) {
e.preventDefault();
var form = this;
bootbox.confirm("Are you sure you want to delete this?", function (result) {
if (result) {
form.submit();
}
});
});
</script>
这在asp.net core
中有效
将整个表单ID命名为(form)