0
I have inside this bootbox, two buttons, on the first one written "Send Error Report" I wanted when the person clicked it to show a glyphicon indicating that it is processing the sending and made it impossible for the person to click again. Down with 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 putting it there in that context?
put your html code in question
– Phelipe
There’s the code, my friend, in javascript if you write html the way above
– WPfan
Friend, when you click the button you make an ajax call? if yes put the code here
– Phelipe
yes, I edited the question, take a look
– WPfan
I know I should use this $(Document). ready(Function(){ $(".btn").click(Function(){ $(this).button('sending'); }); }); The problem is how to insert this into the bootbox
– WPfan
The solution worked?
– Phelipe