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

138
Views
How to set default select of RadioGroup in Material-UI

I have a MCQ Select using RadioGroup in my code. Once the user selects and submits the value he should be able to come back and see the option he has selected. (Like google Forms where I can come back and see the option I selected before highlighted.)

Here is my code :

<FormControl component="fieldset">
    <RadioGroup onChange={(event)=>{formData.KPI_5_S = event.target.value}} aria-label="status" name="row-radio-buttons-group">
        <FormControlLabel value="Finished with respect to requirements" control={<Radio />} label="Finished with respect to requirements" />
        <FormControlLabel value="In progress" control={<Radio />} label="In progress" />
        <FormControlLabel value="Yet to start" control={<Radio />} label="Yet to start" />
        <FormControlLabel value="Failed to get the expected result" control={<Radio />} label="Failed to get the expected result" />
    </RadioGroup>
</FormControl>

How do I achieve this result?

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

0

You can set the defaultValue in the RadioGroup. See the full API of RadioGroup here. The default value is one of the value prop of the Radio inside:

<FormControl component="fieldset">
    <RadioGroup defaultValue="In progress" {...}>
        <FormControlLabel value="Finished with respect to requirements" control={<Radio />} label="Finished with respect to requirements" />
        <FormControlLabel value="In progress" control={<Radio />} label="In progress" />
        <FormControlLabel value="Yet to start" control={<Radio />} label="Yet to start" />
        <FormControlLabel value="Failed to get the expected result" control={<Radio />} label="Failed to get the expected result" />
    </RadioGroup>
</FormControl>
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!