I am having a bit of an issue getting the values of this mutliselect box.
I have a php foreach looping out each available option which shows up perfectly fine. But when I select an option from the drop down, my hidden field receives every possible value from the drop down instead of the ones I selected. Any help?
$('.ui-multiselect-menu input:checkbox').on('change',function() {
selectedItems = new Array();
console.log(selectedItems);
$(".ui-multiselect-menu input:checkbox").each(function() {
if($.inArray($(this).val(), selectedItems) != 0){
selectedItems.push($(this).val());
}
});
console.log(selectedItems);
var data = selectedItems.join(',');
$(".live").val(data);
});
Figured out the answer.