Topic: Multiselect checking boxes does not add "selected" to option tag
haol04
priority
asked 1 week ago
Expected behavior When items checked on multiselect form, it is supposed to add "selected" attribute to the corresponding option tag, so that the selected values can be collected and passed.
Actual behavior Selecting any item, (one, two, all items), won't change the option tags. Thus, $('#id_for_multiselect').val() returns an empty array. Screenshot shows the select tag was initialized, and after checking some options, still the option tags are not "selected"
Note: when "multiple" attribute is removed (single-select), it works normally; .val() returns the value of selected option as expected.
Resources (screenshots, code snippets etc.)
Kamila Pieńkowska
staff
answered 1 week ago
I was not able to reproduce the described behaviour. Here is a snippet that demonstrates value array being returned when you click a button: https://mdbootstrap.com/snippets/standard/kpienkowska/6415603
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 8.2.0
- Device: Windows laptop
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: No