Per the following multiselect I need to grab the selected values that are selected from many multidropdowns on one page. I have a generic event handler setup where if a selection is clicked on any of the multiselect on the page it fires a common event. Two problems/questions:
1) How can I tell what muliselect (#Name) the event came from?
2) How can I grab the .val()’s from the multiselect click function if the event is from the same container?
// generic event for all multiselect
$("select").multiselect({
click: function (event, ui) {
// 1 - What multiselect container?
// 2- Get the list of selected values
var vals = $('#CNames').val(); // This doesn't work if the event was fired from #CNames..null.
var vals = $('#CAreas').val(); // This works if the event came from #CNames.
You can probably get the id of the select that was clicked with
and the values of all the selects with
or the current select with