A progressive enhancement to select multiple form elements using jQuery (fork of the asmSelect - http://www.ryancramer.com/projects/asmselect/)
based on asmSelect - Alternate Select Multiple by Ryan Cramer
Include jquery, bsmSelect, and css in document head:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.bsmselect.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.bsmselect.css" />
Use a jQuery selector in your document ready function:
jQuery(function($) {
$("select[multiple]").bsmSelect();
});
If desired, you can specify options when you call the plugin:
jQuery(function($) {
$("select[multiple]").bsmSelect({
addItemTarget: 'top'
});
});
The newly created select default option is the original select title attribute:
<select name="cities" multiple="multiple" title="Please select a city">
...
</select>
listType:
highlightEffect:
showEffect:
hideEffect:
hideWhenAdded:
addItemTarget:
debugMode:
extractLabel:
plugins
inittitle
removeLabel:
highlightAddedLabel:
highlightRemovedLabel:
containerClass:
selectClass:
listClass:
listSortableClass:
listItemClass:
listItemLabelClass:
removeClass:
highlightClass:
see history.md.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.