I have inside this bootbox, two buttons, the first one that is written "Send Error Report" I wanted it when the person clicked it it would type a glyphicon indicating that it is processing the sending and it precludes the person from clicking again. Below my code:
<script src="~/Scripts/bootbox.min.js"></script>
<script>
$(document).ready(function () {
$.getJSON('@Url.Action("Ajax_Teste")', function (response) {
alert("getJson sucesso");
}).fail(function (data) {
bootbox.confirm({
message: "Não foi possível processar a sua requisição",
buttons: {
confirm: {
label: '<span class="glyphicon glyphicon-envelope"></span> Enviar o relatório de Erro.',
className: 'btn-success',
},
cancel: {
label: 'Não enviar',
className: 'btn-danger',
}
},
callback: function (result) {
//aqui entrará meu código
if (result)
console.log("confirmou");
else
console.log("cancelou");
}
})
});
});
</script>
I know I should insert this here:
$(document).ready(function(){
$(".btn").click(function(){
$(this).button('enviando');
});
});
More like inserting this there in that context?