I am trying to get the values from my select list on a jquery mobile app.
Here is my select markup:
<div data-role="fieldcontain">
<label for="stuff" class="select">Stuff:</label>
<select name="stuff" id="stuff" multiple="multiple">
<option value=''>Select One</option>
<option value="Stuff 1">Stuff 1</option>
<option value="Stuff 2">Stuff 2</option>
<option value="Stuff 3">Stuff 3</option>
<option value="Stuff 4">Stuff 4</option>
<option value="Stuff 5">Stuff 5</option>
<option value="Stuff 6">Stuff 6</option>
</select>
</div>
How do I get the comma separated string of values from this multiselect
You can try to use jquery
val()method to retreive array of selected values andjoinmethod to combine them: