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

155
Views
Created the dynamic radio, but it is affect others

I have created the dynamic radio list , and it is displaying correct data based on item.

   {item.responseType === "radio" && (
                          <div className="form-control-wrap">
                            {item.options
                              .split(",")
                              .map((list, indexRadio) => (
                                <Form.Check
                                  key={indexRadio}
                                  id={item.id}
                                  label={list}
                                  name="radio"
                                  value={list}
                                  onChange={(e, indexRadio) =>
                                    handleChange(e, indexQuestion)
                                  }
                                  type="radio"
                                />
                              ))}
                          </div>
                        )}

But When I am selecting ant one option it is affecting others,

Like if I select Question No 1 ,it is working fine ie : it is selecting only one option, but when move to Question number 2 and select any option it is selecting data from question 2 but, question one options will set to initial state.(it is getting reset)

Let me know what should I do ?

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

0

you are using name="radio" that is same for all so it is treating all the radio buttons from same group. use same name for all options of same question. it will solve your issue. you can use question id for radio button name so that it will be same for all options of that question and different from other question.

about 4 years ago · Juan Pablo Isaza Report

0

I think using this variation will get you to your goal : Change the Key in <Form.Check/>

<Form.Check
   key={item.id}
 />
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!