Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Validation - Validate File #25399

Closed
prbrazildev opened this issue Jan 22, 2018 · 3 comments
Closed

Form Validation - Validate File #25399

prbrazildev opened this issue Jan 22, 2018 · 3 comments

Comments

@prbrazildev
Copy link

prbrazildev commented Jan 22, 2018

.form-control,

I would like to add a file validation on the following form:

.form-control,
.form-control-file,
@mdo
Copy link
Member

mdo commented Jan 22, 2018

Agreed, this would be rad. It won't be possible for custom file inputs though; their overall styling requires markup that features a <label> wrapping around an <input>.

@ysds
Copy link
Member

ysds commented Feb 2, 2018

@mdo We can not change the style of <input type="file">, but how about adding support for validation feedback?

  .form-control-file {
    .was-validated &:#{$state},
    &.is-#{$state} {
      ~ .#{$state}-feedback,
      ~ .#{$state}-tooltip {
        display: block;
      }
    }
  }

@philgyford
Copy link

This does seem like a bug.

For example, .invalid-feedback elements do not show up when they're immediately after .form-control-file.is-invalid elements, but they do when after .form-control.is-invalid elements.

In fact this was reported in #24831 but I think the fix there only fixed the situation for custom file inputs, rather than the standard ones.

Here's a demonstration (copied from that issue but with Boostratp v4.0.0): https://jsbin.com/vodacon/edit?html,output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants