Enable A Disabled Select


Topic: Enable A Disabled Select

theotherguy pro premium priority asked 4 years 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 priority commented 4 years ago

Text lengh requirement


Arkadiusz Idzikowski staff answered 4 years 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 priority commented 4 years 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.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: 1.0.0
  • Device: na
  • Browser: na
  • OS: na
  • Provided sample code: No
  • Provided link: No