Topic: Validations do not work well using FormGroup in an input file.
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>
<input class="file-path" type="text" placeholder="Upload your file" [value]="showFiles()">
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.
Services & Consulting
Hire our experts to help you design or build a dedicated project.
- User: 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