Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

angular how to check a radiobox

<p>
   <input type="radio" value="male" name="gender" [ngModel]="user.gender" > Male
   <input type="radio" value="female" name="gender" [ngModel]="user.gender" > Female
</p>
<p>
   <input type="checkbox" name="tc" [ngModel]="user.isTCAccepted" >
</p> 
Comment

angular 9 radio button checked

Try to specify value attributes. And do not forget that in case of radio buttons Model is not supposed to contain boolean value but should contain radio specific values like:

  <input type="radio" name="food" value="beef" [(ngModel)]="myFood"> Beef
  <input type="radio" name="food" value="lamb" [(ngModel)]="myFood"> Lamb
  <input type="radio" name="food" value="fish" [(ngModel)]="myFood"> Fish
Comment

PREVIOUS NEXT
Code Example
Javascript :: replace is not working in javascript 
Javascript :: discord.js get user by username 
Javascript :: react native flexbox 2 columns 1 fixed width 
Javascript :: react toggle state 
Javascript :: javascript child element selector 
Javascript :: eliminar comillas de un string javascript 
Javascript :: how to get table last row id in jquery 
Javascript :: javascript max 
Javascript :: kendo datasource get 
Javascript :: how to check if a string is an integer javascript 
Javascript :: how to access key value pair in javascript 
Javascript :: get parameter from url reactjs 
Javascript :: find multiple javascript 
Javascript :: comment in javascript 
Javascript :: chrome storage local example 
Javascript :: chart js two layer label 
Javascript :: sort by date javascript 
Javascript :: image react 
Javascript :: sublime javascript autocomplete 
Javascript :: javascript array filter elements greater than 
Javascript :: antd tag 
Javascript :: get input js 
Javascript :: car image api free 
Javascript :: static js 
Javascript :: handlebarsjs each first element 
Javascript :: run node.js code with python 
Javascript :: children javascript 
Javascript :: how can we open page on new tab in angular or js or typescript 
Javascript :: jquery onlcikc css 
Javascript :: javascript array read object value in array 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =