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

346
Vistas
Select2 element not behaving correctly

So I’m using the select2 library for my drop down search list now my issue is that it’s not actually letting me select any of the options and no tutorial is able to help me do what I need to do. Which is when I click on the drop down box and find the option I want, once I click that option it should display in that drop down box.

This is what I have code wise so far:

<select id=“select_field”>
<?php 
      foreach($options[‘values’] as $option){
         echo ‘<option value=“‘.$option[‘id’].’”>’.$option[‘name’].’</option>’;
   }
?>
</select>

<script type=“text/javascript”>


$(document).ready(function(){
$(‘#select_field).select2({});
});

</script>

So I’m not sure what exactly I’m missing to make the option selectable? Any help will be appreciated and I know the speech marks are wrong but I’m writing this up on my ipad

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