Skip to content

form-check-inline and invalid-feedback rendering issue #25540

@GBH

Description

@GBH

This is a valid way to render inline inputs. In order to show invalid feedback we need to cram it on the last container there or it will be display: none. Obviously it renders like hell. (can't get JS bin to work, sorry)

<div class="form-check form-check-inline">
  <input class="form-check-input is-invalid" type="checkbox" value="x" name="user[test][]" id="user_test_x" />
  <label class="form-check-label" for="user_test_x">X</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input is-invalid" type="checkbox" value="y" name="user[test][]" id="user_test_y" />
  <label class="form-check-label" for="user_test_y">Y</label>
  <div class="invalid-feedback">is invalid</div>
</div>

I don't have a solution, just providing an example.

For server-side validations it's easy to override css and add display: block for invalid-feedback.

Demo: https://codepen.io/anon/pen/vdGNWo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions