I want have have a "Loading. . .
" whenever I click on the "Submit
" button. In this case, how come it did not display the "Loading. . .
" thingy? bootstrap 2.3.2
<input type="submit" data-loading-text="Loading..." disabled="disabled" style="" id="save" class="btn btn-primary " value="Submit" name="save">
Here's my JS:
$('#save').click(function() {
var btn = $(this);
btn.button('loading');
btn.button('reset');
});
I can't find any error in console either. What did I miss?
Try this:
$('#save').click(function() {
var btn = $(this);
btn.val(btn.data("loading-text")); setTimeout(function() {
btn.val('reset');
}, 2000);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<input type="submit" data-loading-text="Loading..." style="" id="save" class="btn btn-primary " value="Submit" name="save">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With