Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda