jeudi 23 février 2023

Angular how do I implement mutually exclusive checkbox

        <div>
            <input type="checkbox" class="toggle" name="coordinatorSearch" id="coordinatorSearch" formControlName="coordinatorFilter" (click)="validateOption($event)"/>
            <label for="coordinatorSearch">Coordinator</label>
        </div>
        <div>
            <input type="checkbox" class="toggle" name="employeeSearch" id="employeeSearch" formControlName="employeeFilter" (click)="validateOption($event)"/>
            <label for="employeeSearch">Employee</label>
        </div>

How do I make these checkboxes mutually exclusive? If the user clicks the 'employeeSearch' to the on poistion then we toggle the 'coordinatorSearch' off (if it had been on)

I just don't want two switches turned on but both can be turned off.




Aucun commentaire:

Enregistrer un commentaire