Topic: Validations do not work well using FormGroup in an input file.

yeisonvelez11 free asked 6 years ago


I tried to replicate this example, and the validation errors are not shown where it corresponds, and it also appears as invalid at some moments when I have already selected a file. the only validation that I put is that it was required

<div class="file-field md-form m-0">
<input type="file" mdbFileSelect class="fileinput" accept="image/x-png,image/gif,image/jpeg" required mdbInputDirective data-error="File is required" data-success="file required" formControlName="image">
<div mdbBtn size="sm" class=" color_arrow waves-light" mdbWavesEffect>
<span>Choose Image</span>
</div>
<div class="file-path-wrapper">
<input class="file-path" type="text" placeholder="Upload your file" [value]="showFiles()">
</div>
</div>

Arkadiusz Idzikowski staff answered 6 years ago


We will take a closer look at this problem. If you need to add validation to element other than normal input, please use our new validation method instead of mdbInputDirective.

MDB Angular Validation



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.0.0
  • Device: web
  • Browser: chrome
  • OS: windows 10
  • Provided sample code: Yes
  • Provided link: No