It can also be done with pure Javascript, without the need for external libraries.
For example, to disable the accept button:
var btnAceptar=document.getElementById("AgregarPreviewFlashReport");
var disableButton = function() { this.disabled = true; };
btnAceptar.addEventListener('click', disableButton , false);
<div class="modal-footer">
<button type="button" class="btn btn-default" id="btnCancelarPreviewFlashReport" data-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-success" id="AgregarPreviewFlashReport" name="AgregarPreviewFlashReport"><span class="fa fa-check"></span> Aceptar</button>
</div>
If you need to do the same with the Cancelar
button, it would be enough to create a reference to the element and assign the listener:
var btnCancelar=document.getElementById("btnCancelarPreviewFlashReport");
btnCancelar.addEventListener('click', disableButton , false);
If there are many elements, all can be selected by a class and assigned the listener within a forEach
.