I'm trying to show spinner loader when I click on submit button but submit button is not working. spinner loader appears for some time but submit button not hitting to the controller method. And if you have any better login on this please guide me.
Here's my button code
- <button id="send-button" class="btn btn-primary form-side__btn" type="submit" >Send
- <div id="button-spinner" style="margin-left: 10px; width: 15px; height: 15px; display: none" class="spinner-border"></div>
- </button>
And Here's my jquery code
- $(document).ready(function () {
- $('#send-button').click(function () {
- $('#send-button').attr('disabled', true);
- $('#button-spinner').show();
- setTimeout(function () {
- $('#button-spinner').hide();
- }, 2000);
- });
- });