Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
Angular: How to Select 2 Radio Buttons between 2 Radio Groups in Material?

This is my component form:

<div class="col-3 col-sm-3 col-md-3 mb-2">
    <mat-radio-group aria-label="Select an option" formControlName="gender">
        <mat-radio-button [value]="true" [checked]="false" name="male">Male</mat-radio-button>
        <mat-radio-button [value]="false" [checked]="false" name="famale">Famale</mat-radio-button>
    </mat-radio-group>
    <mat-radio-group aria-label="Select an option" formControlName="name">
        <mat-radio-button [value]="false" [checked]="false"  name="benjamin">Benjamin</mat-radio-button>
        <mat-radio-button [value]="true" [checked]="false"  name="sarah">Sarah</mat-radio-button>
    </mat-radio-group>
</div>

I want to achieve something like this:

If i select the gender the name should be selected automatically refering to the current selected gender

enter image description here

i.e. if I select the gender, the name referring to the currently selected gender should be automatically selected.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

<div class="col-3 col-sm-3 col-md-3 mb-2">
    <mat-radio-group aria-label="Select an option" formControlName="gender">
        <mat-radio-button [value]="true" [checked]="false" name="male">Male</mat-radio-button>
        <mat-radio-button [value]="false" [checked]="false" name="famale">Famale</mat-radio-button>
    </mat-radio-group>
    <mat-radio-group aria-label="Select an option" formControlName="name">
        <mat-radio-button [value]="true" [checked]="form.controls['gender'].value === true" name="benjamin">Benjamin</mat-radio-button>
        <mat-radio-button [value]="false" [checked]="form.controls['gender'].value === false" name="sarah">Sarah</mat-radio-button>
    </mat-radio-group>
</div>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!