Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chosen Jquery Plugin - getting selected values

How can i get the selected values from the chosen Multi-select Box?

like image 732
Aakash Shah Avatar asked May 09 '12 17:05

Aakash Shah


4 Answers

$("#select-id").chosen().val()
like image 199
Ben Truby Avatar answered Nov 17 '22 11:11

Ben Truby


Like from any regular input/select/etc...:

$("form.my-form .chosen-select").val()
like image 45
Sergii Avatar answered Nov 17 '22 11:11

Sergii


This worked for me

$(".chzn-select").chosen({

     disable_search_threshold: 10

}).change(function(event){

     if(event.target == this){
        alert($(this).val());
     }

});
like image 18
Arvind Avatar answered Nov 17 '22 09:11

Arvind


$("#select-id").chosen().val()

this is the right answer, I tried, and the value passed is the values separated by ","

like image 12
user3423551 Avatar answered Nov 17 '22 11:11

user3423551