Topic: Programmatically select multiselect dropdown items

garrithsteyn pro asked 5 years ago

Hi   How can I programmatically select multiselect dropdown items within client script? It doesn't seem to work when setting the option tag to selected.   Cheers

Jakub Strebeyko staff commented 5 years ago

Hi there, Could you please provide some more context for the way you'd like to use multiselect? Adding the select attribute to the option tag should provide you with multiple options being selected on page load. Regards, Kuba

garrithsteyn pro commented 5 years ago

Hi My requirement was to auto select multiselect items after an ajax call. I managed to resolve it by editing mdb.js and setting the id of each list item and trigger the click event for each required option.


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



Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No