Angular 2: radio buttons not working -
i intend these 2 radio buttons such user can select 1 or other. both showing on form checked , cannot unchecked.
<div class="form-group"> <label class="col-sm-12"> <input type="radio" name="paymenttype" id="paymenttype" [(ngmodel)]="payment.paymenttype" [value]="paypal" required> </label> </div> <div class="form-group"> <label class="col-sm-12"> <input type="radio" name="paymenttype" id="paymenttype" [(ngmodel)]="payment.paymenttype" [value]="credit" required> </label> </div>
<div class="form-group"> <label class="col-sm-12"> <input type="radio" name="paymenttype" [(ngmodel)]="payment.paymenttype" [value]="paypal" required> </label> </div> <div class="form-group"> <label class="col-sm-12"> <input type="radio" name="paymenttype" [(ngmodel)]="payment.paymenttype" [value]="credit" required> </label> </div>
remove name in both radio
buttons , [checked]
binding, both unchecked @ first. radios same name in radio group, when check 1 radio
button other unchecked.
Comments
Post a Comment