ASP.NET MVC check form input is valid on submit

Posted by Gavin on Stack Overflow See other posts from Stack Overflow or by Gavin
Published on 2010-01-13T21:54:45Z Indexed on 2010/04/15 20:03 UTC
Read the original article Hit count: 479

Hi all,

I have a form that when submitted shows a busy animation and disables the submit button.

Anyone know how to query Microsoft's Sys.Mvc.FormValidation to see if the form passed it's test so I can prevent the busy animation showing if the form hasn't actually been submitted? Or even some other work-around?

At present my client side javascript looks like this:

$('form').submit(function() {
    $('input[type=submit]', this).attr('disabled', 'disabled');
    ShowBusy();
});

Cheers, Gavin

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about input-validation