Default CSS class for validation messages is incorrect in Bootstrap 3
See original GitHub issueWhen 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.
Issue Analytics
- State:
- Created 10 years ago
- Comments:19 (13 by maintainers)
Top Results From Across the Web
Bootstrap 3 Validation state, 'Error' showing by default
When you add the class has-error to the form-group div.. Bootstrap is only applying the CSS error on elements inside of the from-group....
Read more >Validation · Bootstrap v5.3
Provide valuable, actionable feedback to your users with HTML5 form validation, via browser default behaviors or custom styles and JavaScript.
Read more >Validation · Bootstrap v5.0
Provide valuable, actionable feedback to your users with HTML5 form validation, via browser default behaviors or custom styles and JavaScript.
Read more >Forms
It provides a flexible class that encourages proper grouping of labels, controls, optional help text, and form validation messaging. By default it only ......
Read more >CSS
Global CSS settings, fundamental HTML elements styled and enhanced with extensible classes, and an advanced grid system. Overview. Get the lowdown on the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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:
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.
Sorry, I misread your last post…
Having a way to attach a custom class name would be ok. But it there really time that you will not want the validation message to follow the error status of the
form-group
? For me, usingShowValidationMessage()
is like usingHelpText()
but with the shortcut of having the validaton message extracted automatically for me.If the option to specify a custom class for the
ShowValidationMessage()
is chosen, I think that theHelpText()
should follow the same rule.What do you guys think?