Validation on MVC5
Today, I want to share jqury validation on MVC5.
UI validation on MVC5 doesn’t highlight the text input area by default as below.
It only displays validation messages if the model has validation error on it.
But I’m sure you already seen something like below somewhere on the web.
“input-validation-error” class is added to the input text box where validation error occurred.
Yes, we can add css attribute to this class and give some eye-catching effects.
This can be achieved by simple css styles.
For example, above effect can be achieved by single css style.
.input-validation-error { border: 1px solid #e80c4d;}
MVC5 by default, only add input-validation-error classes to the validated elements but the css.
Adding css is left for you.
Reference: https://stackoverflow.com/a/39180623