In my application, I have both a Save and an Update button. I am using reactive forms where the Save button is disabled if any of the validator fields are not filled, and it gets enabled once all validator fields are filled. However, in the case of the Update button, it always remains enabled since all validator fields are already filled.
Now, when I click on the edit button, I want the Update button to be initially disabled. It should only get enabled if I edit any of the fields in edit mode, provided that all validator fields are also filled.
HTML:
<div class="col-sm-12 col-xs-12 emr-labels no-padd" [formGroup]="emrPatientdetailsForm">
...
TS:
public patientFormInit() {
//Add
this.PatientForm = this.FB.group({
MiddleName: null,
LastName: [null, Validators.required],
});
}
...