I have been trying to follow the tips in this topic Bootstrap: Open Another Modal in Modal but I don't seem to be getting any results. I have two modals, the main one with id testModal and another one that opens when a link is clicked, with id salesModal.
$(document).on('show.bs.modal', '#salesModal', function (event) {
//alert('Test Modal');
var zIndex = 1040 + (10 * $('.modal:visible').length);
$(this).css('z-index', zIndex);
setTimeout(function() {
$('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack');
}, 0);
});
but the salesModal still opens behind the testModal. Which part am I missing and doing wrong? As you can see, I had a debug alert in there to ensure that I am reacting at the right time, ie. when salesModal opens and that works fine.