We need to disable the button after a click to prevent it from being clicked again.
$('#btnSubmit').on('click',
function(e) {
$(this).attr('disabled', true);
});
It works fine in Microsoft Edge. But in Chrome, the button is disabled and the form is never submitted. It seems that Chrome has an implicit event.preventDefault()
when we mess up with the button.
How can we disable the button without preventing the form from being submitted?