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: Disable Enable Select Options Dynamically

Hafid75 free asked 4 years ago


I try to make options of select "Y" deactivated and reactivated depending on options selected in select "X".

My code works as long as select "Y" is not selected, if select "Y" is selected once, the code doesn't work.

https://mdbootstrap.com/snippets/jquery/hafid75/1854418

Thanks very much for help !


Grzegorz Bujański staff commented 4 years ago

Hi. After change you should reinit material select. Add

$('.mdb-select').materialSelect({ destroy: true }); $('.mdb-select').materialSelect();

inside on change function


Hafid75 free commented 4 years ago

Hello Grzegorz !

Thank you for your reply, it's very gracious of you.

This solution works only on mdbootstrap online console, on my PC (with a basic index.html file) it made the mess, each time I click on select "X" it gradually erases bootstrap style of the parent containers, I don't know how to restore original bootstrap style, I'm a bit lost because this problem doesn't happen when I use pure bootstrap select without material design, you can check using a basic index.html file on your PC.


Grzegorz Bujański staff commented 4 years ago

Hi. I can't reproduce this error. I don't see missing styles of the parent container.


Hafid75 free commented 4 years ago

Hello Grzegorz !

I sent you by message the link to the online example showing what I'm saying, so you can see each time we click on select "X" it gradually erases bootstrap style of the parent containers.

Best regards !


Grzegorz Bujański staff commented 4 years ago

In online example you use MDB 4.13.0. This issue is solved in MDB 4.14.0. Please update to the latest version.


Hafid75 free commented 4 years ago

Hello Grzegorz !

I just updated to MDB-Pro_4.14.1, and the problem is not really resolved, if bootstrap style of the parent containers doesn't erase each time we click on select "X", however the select "Y" multiplies into several selects after nth click on select "X", I'm sorry to bother you with that, if this is causing you any problems, it's not a big deal, we could always use pure bootstrap select without material design.

Cordially, Hafid.


Grzegorz Bujański staff commented 4 years ago

Hi. It's hard to say why this is happening. We'll look at this and try to fix this problem



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Opened

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.14.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows 7
  • Provided sample code: No
  • Provided link: Yes