|
|
|
|
<script type="text/javascript">
jQuery(function($){
// (OPTIONAL) adjust the width of the select box to the bigger of the two
$("select[name='selected']").selectAdjustWidth("select[name='available']");
$("select[name='selected']").multiSelect("select[name='available']", {
trigger: "input[name='remove']",
triggerAll: "input[name='removeAll']"
});
$("select[name='available']").multiSelect("select[name='selected']", {
trigger: "input[name='add']",
triggerAll: "input[name='addAll']"
});
});
</script>
$("select[name='selected']").selectAdjustWidth("select[name='available']");
Put this in DOM ready code if you want the select boxes to have the same width: the width of the bigger of the two.
If you want other elements to invoke the movement of the <option> elements, provide a selector for them here. Defaults to none.
Provide a element to move all <option> elements. Defaults to none.
If you want the options to be sorted so they always appear in the same order. Defaults to true.
By default, if the <select> has a parent <form> all of its child <option>s will be selected on that form's submit event. Without this the <option> values are not submitted. Defaults to true.
A function to be called before moving the elements. Return true to continue moving the elements, false to cancel the operation. Defaults to none.
A function to be called after moving the elements. Defaults to none.