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

298
Vistas
Can't retreive values from bootstrap-selectpicker

I have a bootstrap multiple select-picker (not select) elements where my goal is to get the values out of them.

 <select id="custom_include" class="selectpicker" name='custom_include[]' data-header="Select target Groups" multiple data-actions-box="true" data-live-search="true" data-title="Target Groups"  data-show-tick="true" data-none-results-text="No groups matching" data-style="" data-style-base="form-control">
        {% for group in target_groups %}
           <option value="{{ group }}">{{ group }}</option>
        {% endfor %}
</select>

When I try searching by value:

$('#custom_include').val()

It returns only the first selected item in the dropdown.

When trying to search by selected text:

$('#custom_include').find("option:selected").text()

returns selected items stuck to each other as strings like the following example:

'dj dj.jewar@xol.comha ha.nyen@xol.com'

where the first entry is dj dj.jewar@xol.com and the second is ha ha.nyen@xol.com

When trying .text()

$('#custom_include').text()

it returns the entire content of the dropdown regardless what was selected.

For me it seems impossible but is there a way to return the selected values as arrays?

However, so far this seemed impossible to get all selected values.

about 4 years ago · Santiago Gelvez
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