问题
I have a form, when submitted, will turn the cursor: waiting. However if the MVC validation gives an error message because the property is required, the cursor does not turn back. How can I handle this? Here is how I am handling it now. I searched the forums, but nothing is working. Thank you.
$("form").submit(function () {
//if MVC validation fails do not do this
$("*").css("cursor", "wait");
});
jQuery(window).load( function () {
//called after the load is finished.
$("*").css("cursor", "auto");
});
回答1:
You should check whether the form is valid then you can turn the cursor.
$(function () {
$("form").submit(function () {
if ($(this).valid()) {
$("*").css("cursor", "wait");
}
});
});
来源:https://stackoverflow.com/questions/21633201/mvc-validation-form-submit-cursor-waiting-issue