Reputation: 1734
I have a 2 modals in the root of my markup and although the docs say not to use more than one at a time I have a scenario where from a users perspective I think it would make the most sense to have 2 modals. Problem is that once the second modal opens, it will dismiss the first as well as the second. Is there any way to target a specific modal or id with data-dismiss="modal"
as I am assuming this is where the logic for dismissing modals is?
Upvotes: 0
Views: 102
Reputation: 2362
I'd use JQuery//Bootstrap to close them like:
$('#modal1').modal('hide');
EDIT:CMedina was faster ;)
Upvotes: 1
Reputation: 4242
$('#myModal').modal('hide');
Is the correct syntax to close/hide the modal with id myModal (you can test this on the Bootstrap documentation page).
Upvotes: 1