13. May 2011 01:59
/
0
/
Comments (4)
If you are using the ASP.net MVC3 built in validation such as
1: @Html.ValidationMessageFor(m => m.Username)
you can easily change the validation by overriding the CSS class field-validation-error like this:
1: .field-validation-error
2: {
3: color: red;
4: }
5:
6: .validation-summary-errors
7: {
8: color: Red;
9: }
The CSS above is the one used for the span that will contain the invalid error message for the specific field and for the validation. furthermore, you can bring more attention to the input that caused the error by adding a class like this (please note this one only works with inputs):
1: input.input-validation-error
2: {
3: background-color: orange;
4: }
Happy programming!
840c5a3a-e9b2-4aaa-8b9c-028d638d4358|0|.0|27604f05-86ad-47ef-9e05-950bb762570c