Topic: Input Default Validation 7.1.1

itdev pro asked 5 years ago


We upgraded MDBootstrap from version 5+ to 7.1.1. One thing we noticed in our project now is that all the input fields that have [(ngModel)]='...' by default have validation ON instead of OFF. Is there a way to globally set the validation to off? If not, what is the best practice that was intended for such major change. We have over 2000 input fields across our app. This will be a nightmare trying to update all of them. Any guidance will be appreciated.


itdev pro answered 5 years ago


I would recommend that you do not change default behavior in major version releases since those changes effect an entire project and requires major refactoring.

What we used was the following using version 7.2.0:

mdbInput for all fields that do not require validation

mdbInput mdbValidate for all fields that do require validation.


Damian Gemza staff answered 5 years ago


Dear @itdev 

Unfortunately, there's no option to set the global validation state.

But if you're using some smart IDE like WebStorm or IntelliJ you can search your entire project for occurrences of mdbInputDirective, and change it to mdbInputDirective mdbValidate="false".

This will turn off validation in your inputs.

Best Regards,

Damian



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.0.0
  • Device: Any
  • Browser: Any
  • OS: Any
  • Provided sample code: No
  • Provided link: No