jsp - how to set selected option in jquery multiselect -
i use jquery multiselect. want set option selected when write selected="selected" attribute option multiselect doesn't run correctly. example when 2 option selected deselect option after number of selected doesnt decrease. use control 6: callback in this demo.
my javascript:
$(document).ready( function() { $("#identificationmethods").multiselect( null, function(el) { ... }); });
my html
<select id="identificationmethods" name="identificationmethods[]" multiple="multiple" style="width: 100px;"> <c:foreach items="${identificationmethodics}" var="im"> <option <c:if test="${im.selected == true}">selected="selected"</c:if> value="${im.subtype}"> ${im.subtype} </option> </c:foreach> </select>
Comments
Post a Comment