Enabling/Disabling select element using jQuery not working w


Topic: Enabling/Disabling select element using jQuery not working with update

jps mack pro asked a year ago

Expected behavior: Select box becomes enabled when there is a change to a different select box

Actual behavior: Select box remains disabled

**Resources (screenshots, code snippets etc.)**

When changing to the pro version, some functionality has been lossed. Upon changing a select box, I had a code that enabled a different select box depending on if a value had been selected in the first box. I have since lost this functionality and am unable to debug this problem. Here is my code:

function enableVend(){
  if ("#pro option:selected") {
    console.log('should enable');
    $("#vendorid").prop('disabled', false);
  } else {
    $("#vendorid").prop('disabled', true);

It is everything is working as it should other than:

$("#vendorid").prop('disabled', false);

All help is very appreciated.

Also my MDB version is actually 4.8.1

AdamJakubowski staff answered a year ago


please, create a snippet showing your problem here: https://mdbootstrap.com/snippets/. I'll try to help you.



Please insert min. 20 characters.


Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: jQuery
  • MDB Version: 4.8.0
  • Device: Dell XPS 15 9550
  • Browser: Chrom
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No