I have a dropdown menu with checkboxes that can be selected using SumoSelect. Here is the markup for the dropdown menu:
<select multiple="multiple" name="somename" id="uq" class="select">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
<option value="bmw">BMW</option>
</select>
And here is the jQuery function to handle the dropdown click event...
$(document).ready(function () {
$('.select').SumoSelect({});
var v = $("#uq").val();
});
I am referencing this link to implement the multiselect checkbox option in the dropdown menu, but I am struggling to retrieve the selected values.
Your assistance would be greatly appreciated. Thank you.
Update
$("#submit").click(function (event) {
event.preventDefault();
alert(v);
console.log(v);
});
Update 2
$(document).ready(function () {
$('.select').on('change', function (e) {
console.log($(this).val()) // value
}).SumoSelect({});
$("#submit").click(function (evt) {
evt.preventDefault();
var v = $("#uq").val();
alert(v)