I have a ValidationSummary that works pretty well, although it doesn't go away after the last of the form errors are rectified.
I'm not sure if this is default behavior or a bug. It seems more towards the latter, since they don't go away after my form has been submitted.
The only thing I suspect might be impacting the functionality is that the form is created through Ajax.BeginForm()
.
Even still, shouldn't the ValidationSummary disappear right as I hit the submit button?
You can make it hide on form submit in your javascript. If you inspect element on your validation summary, you'll notice it changes styles from .validation-summary-valid
to .validation-summary-errors
if there are any errors. So this makes it easy to hide.
e.g.
$('#formName').submit(function() {
if ($(this).valid()) { // checks form is valid.
$('.validation-summary-errors').hide(); // hides it
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With