TwitterBootstrapMvc: Default CSS class for validation messages is incorrect in Bootstrap 3

When rendering a validation message, BMVC adds the class help-inline to the <span> tag wrapped around the message. This class no longer appears to be relevant in Bootstrap 3. The only help-related class in the Bootstrap 3 source is help-block.

I can work around the issue by explicitly requesting a block-level validation message, but it really should be the default for Bootstrap 3.

About this issue

  • Original URL
  • State: open
  • Created 11 years ago
  • Comments: 19 (13 by maintainers)

Most upvoted comments

It is true that has-error class has effect on help-block. However, I didn’t even notice it because the default project creates a css file with default validation related css rules:

/* styles for validation helpers */
.field-validation-error {
    color: #e80c4d;
    font-weight: bold;
}

.field-validation-valid {
    display: none;
}

input.input-validation-error {
    border: 1px solid #e80c4d;
}

.validation-summary-errors {
    color: #e80c4d;
    font-weight: bold;
    font-size: 1.1em;
}

.validation-summary-valid {
    display: none;
}

Just tweak these to match error colors to Bootstrap colors and you are good to go. I think this is a better solution than messing with margins.