I have a button that I have tied to some JS that is disabling the button and changing the text to 'Loading...' once clicked, then the APIs go to work(around 12-15 seconds). However when I click the button it just says 'Loading..' and the form doesn't submit, to clarify nothing is happening besides the button changing. Preferably I'd like to use 'input' but with that the form submits but the button doesn't change. I am no JS expert so any help is great. Thanks.
<button id="fat-btn" class="btn btn-xs btn-primary btn-block">Get Quotes</button>
<script>
$(function(){
var $btn = $('#fat-btn');
$btn.click(function(){
var $this = $(this);
$this.attr('disabled', 'disabled').html("Loading...");
setTimeout(function () {
$this.removeAttr('disabled').html('Get Quotes');
}, 3000)
document.getElementById("fat-btn").submit();
});
})
</script>