Is it possible to prevent a modal from appearing if certain conditions are met? Example of what I want, more or less:
<button id="abreModal" class="btn btn-info btn-lg" data-toggle="modal" data-target="#modal">Open Modal</button>
//aí no js...
$('#abreModal').click(function () {
if(condicao){
// ... previne modal de abrir
}
});
I know if I take the data-toggle and data-target, and show the modal manually, I can. But I have several buttons like that, and I do not want to have to change them all.