Currently, I am validating forms in an angular project and everything is working correctly. However, I want to take it a step further by disabling the form when the value in a specific textfield noWards
is less than 1
Text Field
<input autocomplete="off" class="input100" type="text" formControlName="noWards" [(ngModel)]="noWards">
Button
<button
[disabled]="!questionsForm.valid || noWards.length < 3"
[ngClass]="{'default':!questionsForm.valid}"
(click)="goToNextStep()" class="contact100-form-btn">
<span>
Start
<i class="fa fa-long-arrow-right m-l-7" aria-hidden="true"></i>
</span>
</button>
JavaScript
this.questionsForm = this.formBuilder.group({
new: ['', Validators.required],
noWards: ['', Validators.required],
user: [''],
pass: ['', Validators.required]
});