tags:

views:

61

answers:

1

Hi. In my asp mvc application I use standard client side validation (DataAnnotations + MicrosoftAjax.js + MicrosoftMvcValidation.js). I need to show some popup message (jGrowl) after successful/unsuccessful client side validation (so I can't use ModelState.IsValid). So I search for some standard flag which indicates client side validation status. Does anybody know about it? Does it exist?

+2  A: 

I don't know if MicrosoftMvcValidation exposes such function but using jQuery you might check if any of the form fields contain errors:

var isValid = $('#formId .input-validation-error').length > 0;
Darin Dimitrov
+1 Very clever.
jfar
Yep, I know this and actually now I use jQuery to check validation status. But I'm sure there are some standard things to do this. But thank you anyway =)
zenonych