Let's say that I have this form structure:
this.entryForm = this.formBuilder.group({
date: [{value:'' , disabled: true}, [Validators.required]],
notes: [''],
sum_credit: [{value:'', disabled: true }],
sum_debit: [{value:'', disabled: true}],
items: this.initItems()
});
// set validation function to sum_credit
this.entryForm.controls['sum_credit'].setValidators([CommonValidations.validateSomthing(...)]);
The sum_credit
is disabled because it's value is always calculated.
Now I need to validate that the sum_credit
is equaled to sum_debit
, and I'm already doing that using validateSomthing
function.
The problem is that the validateSomthing
is not triggered because the control is disabled. How can I fix that?
Thanks