I am a new front end developer and I am having problem doing my project. I used modal in a modal and it works. My first modal is a long modal which needs to be scrolled to see t
When dealing with bootstrap stacked modal, most common problems are
modal-open
removed from <body>
both problems can be solved with custom code as suggested by bootstrap
Multiple open modals not supported
Be sure not to open a modal while another is still visible. Showing more than one modal at a time requires custom code.
$(document).ready(function () {
$('secondmodalselector').on('show.bs.modal', function () {
$('firstmodalselector').css('z-index', 1039); //this will push the first modal overlay behind second modal overlay
});
$('secondmodalselector').on('hidden.bs.modal', function () {
$('firstmodalselector').css('z-index', 1041); //bring back the first modal overlay to it's normal state when 2nd modal closed
$('body').addClass('modal-open'); // add `modal-open` class back to body when 2nd modal close so first modal will be scrollable
});
});