I put a multi select list box on MVC form and setup chosen js, I'm able to select options but when i submit the form no values are submitted, when i checked the markup i came to know selected options are not marked as selected, so what expect is below
<option value="1">Test 1</option>
<option value="2" selected>Test 2</option>
<option value="3" selected>Test 3</option>
But what i can see is as in attached picture.
Chosen won't add the
selected
attribute to your html. If you need to find out what values were selected, use$(selector).val()
.See below for example. In this example, I am initializing a chosen multiselect and assigning it's selected values to some output to demonstrate
$(selector).val()
.