I am using bootbox and I have a button on my modal which is when clicked, it opens another modal. The problem is that when the new modal is opened, the modal behind it does not become dim. Instead, the background behind the two modals just gets dimmer. What should I do to fix it?
Here is my sample code:
$('#new-btn').click(function () {
new_room_form = bootbox.dialog({
title: "New room",
message:
'<div class="row">' +
'<div class="col-md-12">' +
'<form>' +
'<fieldset style="padding: 20px">' +
'<legend>Example:</legend>' +
'<div class="form-group">' +
'<button class="btn btn-primary" id="add">Add</button>' +
'</div>' +
'</fieldset>' +
'</form>' +
'</div>' +
'</div>',
buttons: {
cancel: {
label: "Cancel",
className: "btn btn-default"
},
add: {
label: "Add",
className: "btn btn-primary",
}
}
}); // end bootbox dialog
$('#add').on('click', function(response) {
bootbox.alert("Hello world!", function() {
});
return false;
});
});