Enabling/Disabling select element using jQuery not working w


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

jps mack pro premium asked 2 months 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');
    debugger;
    $("#vendorid").prop('disabled', false);
    debugger;
  } 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 2 months ago

Hi,

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

Best,

Adam


Please insert min. 20 characters.
Status

Answered

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