Topic: https://mdbootstrap.com/support-ask-question/
geekmakersun asked 4 years ago
Expected behavior
Actual behavior I tried and tried and failed Resources (screenshots, code snippets etc.)
stevenmoran answered 2 years ago
Trying to output content from a multiselect list to an array "selectedTexts: The array is declared and has global scope.
Any advice welcome
<select class="form-control"style="max-width:100%" multiple data-mdb-visible-options="6" name="ip" id="ip" onchange=" selectedTexts =Array.from(this.selectedOptions).map(x=>x.value??x.text)" multiselect-hide-x="true" placeholder="Please select a Device from Dropdown list">
<option value="1">192.168.1.201</option>
<option value="2">192.168.1.202</option>
<option value="3">192.168.1.203</option>
<option value="4">192.168.1.204</option>
<option value="5">192.168.1.205</option>
<option value="6">192.168.1.206</option>
</select>
mlazaru staff answered 2 years ago
Hi,
You can't use listener like this, because MDB Select is creating new elements via JS. This HTML code is used only to be based on for our Select instance.
This is the way to make it working:
mdbootstrap.com/snippets/standard/mlazaru/4197992
In case of any questions, feel free to ask :)
PS: In the future, if new problem has no relation with the old one, please create new topic. It will help us keeping forum clear.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 3.8.0
- Device: 1
- Browser: 1
- OS: windows
- Provided sample code: No
- Provided link: No
Sebastian Kaczmarek staff pro premium commented 4 years ago
Try using your user login that you used during registration -
GeekMaker_Sun
. In case you are using social login, remember to use --method flag.