Just to complement @ Roman Holzner's answer ...
In my case, I have a button that shows a tooltip, and it should remain disabled until the actions are completed. Using his approach, modal work, even if the button is disabled, because its call is outside the button - I ended up in the Laravel clip file to be clear :)
<span data-toggle="modal" data-target="#confirm-delete" data-href="{{ $e->id }}"> <button name="delete" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Excluir Entrada" disabled> <i class="fa fa-trash fa-fw"></i> </button> </span>
So, if you want to show modality only when the button is active, you must reorder the tags:
<span data-toggle="tooltip" data-placement="bottom" title="Excluir Entrada" disabled> <button name="delete" class="btn btn-default" data-href="{{ $e->id }}" data-toggle="modal" data-target="#confirm-delete" disabled> <i class="fa fa-trash fa-fw"></i> </button> </span>
If you want to verify it, change the attribute using jQuery code:
$('button[name=delete]').attr('disabled', false);
Thiago Cardoso Apr 6 '17 at 14:05 2017-04-06 14:05
source share