Reputation: 171
All the examples on the page https://sherweb.github.io/ngx-materialize/form-validation have submit button disabled until form is valid. I would like to make it enabled and show validation errors on submit if there are any.
Is it possible?
Upvotes: 1
Views: 344
Reputation: 65
You can directly change the value of pristine key of the input field in the form variable just as the user tries to submit the form.
If your form is invalid execute this.yourform.get('your_input_field').pristine = false;
for invalid field and error messages will be displayed immediately.
Upvotes: 0
Reputation: 9764
You can remove [disabled]="form.valid" from the Submit Button Tag. You can control validation when user press submit button.
Upvotes: 0