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

141
Views
How to enable/disable BsMultiSelect

I am trying to use BsMultiSelect.

How can I manually enable/disable a select menu?

I was able to successfully disable the menu like so

// remove all options
removeOptions(select); 

// disable the select element
select.setAttribute('disabled', true); 

// update the data since all options were removed
select.updateData();

// update the appearance of the menu since it is now disabled
select.updateAppearance();

Then I tried to enable it like this which did not work

// add new options to the select element
addOptions(select);

// enable the select element
select.removeAttribute('disabled');


// update the data since new options were added
select.updateData();

// update the appearance of the menu since it is now enabled
select.updateAppearance();
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

A bit late, but I had an identical problem and solved it by the build-in option getDisabled from bsMultiSelect, which requires either true or false.

I then used $('#yourMultiSelectOption').attr('custom-data-attr', false/true).bsMultiSelect("UpdateDisabled") to first change the attribute to the desired option and then manually trigger an update of the bsMultiSelect.

$(#yourMultiSelectOption).bsMultiSelect({
    getDisabled: function () {
                     return $("#yourMultiSelectOption").attr('custom-data-attr') === 'true';
                 },
    [other options...]
})

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