Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: mdb-select "disabled" cannot be added with jquery

lmcosorio free asked 5 years ago


Not able to add attribute "disabled" to <select class="mdb-select md-form" id="myid"></select> with jquery $('#myid').prop('disabled', true);

What I have tried:

$("#myid").attr("disabled"); And similar solutions. By the way works perfectly with <select class="browser-default custom-select" id="myid"></select>

Any help appreciated.

Thank you.


lmcosorio free commented 5 years ago

I have found some sort of solution. As mdb-select structure is different, you have to target input inside the div. For example: $('div.select-wrapper.mdb-select.md-form input').prop('disabled', true);


Mateusz Łubianka staff answered 5 years ago


Hi,

If you want to use your ID, check out my snippet: https://mdbootstrap.com/snippets/jQuery/mateusz-lubianka/1489225

Best,



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.8.10
  • Device: Laptop
  • Browser: Firefox
  • OS: Windows 10
  • Provided sample code: Yes
  • Provided link: No