mdbootstrap / material-design-for-bootstrap

Important! A new UI Kit version for Bootstrap 5 is available. Access the latest free version via the link below.
https://mdbootstrap.com/docs/standard/
MIT License
9.34k stars 1.15k forks source link

Input validation not working #190

Closed SerhiDi closed 5 years ago

SerhiDi commented 5 years ago

'data-success' and 'data-error' messages not working with mdbInputDirective

In my project I used version "angular-bootstrap-md": "6.2.4". span tags 'inputVal text-success' & 'inputVal text-danger' - are always ignoring any validation, 'visibility: hidden;' in any time.

I used the example code (Error or Success Messages): Inputs

<div class="md-form">
  <i class="fa fa-envelope prefix"></i>
  <input mdbInputDirective data-error="wrong email" [formControl]="emailFormEx" data-success="valid email" minLength="8" maxLength="25"
        type="email" class="form-control" id="form9" name="email" mdbInputDirective>
  <label for="form9">Type your e-mail</label>
</div>

(additional bug) mdbInputDirective - two times in your example


You have an incorrect documentation on examples page: Input validations

Each validators are show wrong messages For example 'minLength validator' - show "wrong" insted "wrong text".

idzark commented 5 years ago

Thank you for letting us know about these problems. We will update examples in our documentation.

Please try to use the code from the Input validation page and let me know if the problem with displaying validation messages still exists (please remember to import ReactiveFormsModule).