There is a form on ASP.NET MVC.
The form displays a model whose properties have certain attributes of standard validation [Required]
When submit form, the validator from standard libraries is activated:
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.unobtrusive*", "~/Scripts/jquery.validate*")); When you add a script to the page, which, when you click on the submit button, locks it, and after 2 seconds makes it active, the form submit does not occur, the lock / unlock script itself works as expected, what's the problem? What do you need to add to this script for submit to work successfully?
$(function() { $(".btn").each(function() { $(this).on("click", function () { var e = $(this); e.attr("disabled", "disabled"); setTimeout(function() { e.removeAttr("disabled"); }, 2000); }); }); });