Hi,
you can check like that in javascript if form is not valid then fire the validation if form is properly filled then u can show the loader as below in MVC.
$.validator.unobtrusive.parse($('#frmFields'));
var $valid = $("#frmFields").valid();
if (!$valid) {
$validator.focusInvalid();
$(".loading").css("display", "inline");
return false;
}
else {
$(".loading").css("display", "inline");
SaveAccount();
return true;
}
});