Skip to content

Form Validation - Validate File #25399

Closed
Closed

Description

@prbrazildev

.form-control,

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

.form-control,
.form-control-file,

Activity

  1. added
    css
    v4
    feature
    on Jan 22, 2018
  2. mdo commented on Jan 22, 2018

    @mdo
    Member

    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>.

  3. ysds commented on Feb 2, 2018

    @ysds
    Contributor

    @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;
          }
        }
      }
  4. philgyford commented on Mar 21, 2018

    @philgyford

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cssfeaturev4

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions