jeudi 2 avril 2020

How to make two different functions to check that the input and the label are both clicked in a checkbox

I have a checkbox containing an input and a link of "Terms and Conditions" as a label. I want two functions to validate the form one to check that the input is checked and one to make sure that the link in the label is visited or clicked. My problem is wherever I click on the label it marks the input as checked also, how to fix it in angular 6 ?

 <form>
    <input type="checkbox" [checked]="checked" (click)="isClickek()">
    <label type ="text" [visited]="visited" (change)="isVisited()">
 </form>

I don't know if I explained it well or not, I want to check both of them separately because I have two cases to handle: for one of them I just need the input to be checkd and for the other one I have to check that both the input and the link are clicked.




Aucun commentaire:

Enregistrer un commentaire