I am working on multiselect group. Here is the link i have populated some data in the multiselect group and the users can select their requirements in that.
http://vignesh.gvignesh.org/chose/chose.php
Here once show selected button is clicked i am calling javascript function.
function chos()
{
var a = $(".chzn-select").chosen();
alert(a);
}
it is not showing the selected values in alert box. Some [object][object] is displayed.
i dont know how to get the selected values. If my javascript function for getting the values is wrong kindly let me know the new function.
Thanks in Advance.
Just use
$("#chossen").val(), which returns an array ofvalues that are currently selected.To get the actual
optionelements that are selected, try$("#chossen").find("option:selected");, and then loop through those (obviously) – in case you want to get theirtext.