ThomasDev-de / bs-select

This jQuery plugin converts a simple select element into a bootstrap dropdown element. It offers numerous options, methods and events for further processing. It was developed on the basis of jQuery 3.6, Bootstrap 5.3 and Bootstrap icons.

Home Page:https://github.webcito.de/#bs-select

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disable Select

marc-gist opened this issue · comments

commented

I can't seem to get the disable to work. I can still make changes to the select.
I set both the disable and class

<select name="blah" disabled class="blah disabled"> ... </select>

Ideas? Thanks!

commented

I modified your code to pass in the select field to the onBeforeChange, and used the css class. seems to work :)

function changeSelect(select) {
        let obj = $(select);
        console.log(obj);
        return !obj.hasClass('isDisabled');
    }

Hi, yes I noticed that too, just haven't had time to test everything thoroughly yet. I made a small change which disables all options if the select has the class disabled.

Let me know if it works now.