twbs/bootstrap

Add a horizontal form validation example (check double label classes)

Closed this issue · 6 comments

The validation feedback for errors (.has-danger) has not been applied to the col-form.label.

screenshot from 2016-10-24 10-49-13

<div class="form-group has-danger">
    <label for="name" class="col-form-label">Name</label>
    <input type="text" id="name" name="name" class="form-control">
    <span class="help-block">The name field is required.</span>
</div>

I'd changed the class for the validation error message to .form-control-feedback, and it now works it, but the issue still remains for the input label. What's the correct class?

In other parts of the docs, there is a reference to .form-text class. What's the correct one: .form-text or .form-control-feedback?

mdo commented

If you're using v4, make sure you have the latest code—this should be working just fine with Alpha 5.

From our documentation:

If I am using the form on the grid, as in the docs:

http://v4-alpha.getbootstrap.com/components/forms/#using-the-grid

Do I have to use both col-form-label and form-control-label classes on my label?

mdo commented

Ah, sorry, yes, right now you do. I think we need to revisit that. Reopening and retitling the issue so we can tackle that.

Thanks!