I am playing with Bootstrap\'s stateful buttons - specifically with Loading state, but still can\'t find the right set up to get it working. I have a simple for
You don't need bootstrap-buttons.js. That's is HTM5, use the custom attributes. This sample does not depends of click event, it is a form submit
var btn = $(this).find("input[type=submit]:focus");
// loading
var loadingText = btn.data('loadingText');
if (typeof loadingText != 'undefined') {
btn.attr("value", loadingText);
}
else {
btn.attr("value", "Loading...");
}
btn.attr("disabled", true);
$.ajax({// long task
complete: function () {
// reset.. the same
});