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

297
Views
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
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!