I want a button to be disabled until a checkbox has been checked using a FormBuilder for Angular. I don\'t want to explicitly check the value of the checkbox and would prefe
HTML Form
Please agree to terms of use and privacy policy.
TS File
regForm: FormGroup;isRegSubmit: boolean = false;
constructor(
private fb: FormBuilder
}
this.regForm = this.fb.group({
agree : [false, Validators.requiredTrue]
});
Validators.required not worked Also, we can show error message by checking the value too and restrict the user to submit but it is not a good approach as we're not using validation, so whenever there is only a single checkbox then add Validators.requiredTrue instead of Validators.required