How to set multiple select to multiple values?


Topic: How to set multiple select to multiple values?

Jordan Mack pro asked 2 years ago

Expected behavior Set select to value to array and all options selected

Actual behavior

only the last option is selected

Resources (screenshots, code snippets etc.)

I use to have this functionality in previous versions, not sure what happened. Is there also the ability to allow the select setValue() method to accept integer or throw an error if one is caught?

Thank you

https://mdbootstrap.com/snippets/standard/jps_mack/4691879#js-tab-view


kpienkowska staff answered 2 years ago

The setValue() method should accept an array as an argument. This works well but you are misusing multiple attribute. I've prepared a snippet in the second thread you opened.


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
  • User: Pro
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 6.0.0
  • Device: Intel x86
  • Browser: Chrome
  • OS: Ubuntu 22.04
  • Provided sample code: No
  • Provided link: Yes