Enable A Disabled Select


Topic: Enable A Disabled Select

theotherguy pro premium asked 7 months ago

Expected behavior I am trying to enable a disabled select item. Im using $("#idofselect").data("disabled", false); The desired result is to enable the select. Actual behavior I have given a select element the class of select. The the select renders like it should. The problem I am having is that I dont know how to enable the select from disabled. Resources (screenshots, code snippets etc.) How do I access an existing select to enable it?


theotherguy pro premium commented 7 months ago

Text lengh requirement


Arkadiusz Idzikowski staff answered 7 months ago

We already know about this problem and we need to fix it on our end. As a workaround for know please re-initialize your select component after change in disabled state:

<select #mySelect class="select"></select>



var mySelect = document.querySelector('#mySelect');
var selectInstance = mdb.Select.getInstance(mySelect);
selectInstance.dispose();
new mdb.Select(mySelect, { disabled: false });

theotherguy pro premium commented 7 months ago

I'm not an actual developer I figured I was doing something wrong. Thanks for your time. Thanks for the work around.


Please insert min. 20 characters.