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

173
Vistas
add/remove dropdown + chosen plugin that depend on the selected dropdown

As Image below,

Image

I am trying to create a form that contains dropdown(task type) + dependent chosen plugin (task name) that the user can add or remove. The dropdown and dependent have the same class to get the value. I dint put id to avoid complicity due to the multiple same id. The option for the task type dropdown is added using the code below :

 $.each(task_type, (key, val) => {
      $(".s-type").append(
        $("<option>", {
          value: val.val,
          text: val.text,
        })
      );
  });

So the problem is, this code will append the previous dropdown too. I have tried to check if the option is already in the dropdown, but the problem is, it detects the 1st dropdown, it dint not detect other dropdowns. So the result ends up only 1st dropdown has an option, other don't have. So how to avoid this duplicate in the dropdown.

The next problem is I don't know how to get the value of the dropdown task type. I know how to get all the value dropdowns. but I don't know how to get the drop-down that changes, to change the option in the task name dropdown. If I use the class, it just detects the 1st dropdown task type.

about 4 years ago · Juan Pablo Isaza
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