I\'m using Bootstrap Modal Window plugin its work fine but i would like to open another model window when i click next and close first one. how can i do it?
Here is a recipe that lets you link two modals together in a general way. The first modal has a button that launches the second modal. When the second modal is closed the first modal is reopened.
// Prevent modal on top of modal while maintaining dismissibility.
// If a sub-modal is dismissed the original modal is reopened.
$('.modal [data-toggle="modal"]').on('click', function() {
var curModal = $(this).closest('.modal');
var nextModal = $($(this).attr('data-target'));
if (curModal != nextModal) {
curModal.modal('hide');
nextModal.on('hide.bs.modal', function() {
curModal.modal('show');
});
}
});
Note: This should only be used if you have at most 2 linked modals. Button on the second modal opening a third would cause unexpected behavior as it would close the second modal, open the third, and reopen the first as well.