jQuery MultiSelect Plugin
Requirements
jQuery MultiSelect requires jQuery 1.4.2+
Usage
$("selector").multiselect([options:Hash])
Options available:
- separator: Separator to use in hidden field containing field value. default: ","
- completions: Options to do auto-complete. default: []
- max_complete_results: Max results at auto-complete box. default: 5
- enable_new_options: If false, user can't use options that aren't in completions. default: true
- complex_search: By default multiselect will do a complex search to match results easier, disable if you have a lot of records and want a faster search. default: true
The completions should be and array with all available completions that you want, each completion should be defined in one of following ways:
- String: using as string, the caption and value will be the same. example: "Hi"
- Array: you can use as Array with 2 elements, where first element will be the caption, and the second the value. example: ["Hey Dude", "dude"]
- Hash: you can send a hash with keys caption and value. example: {caption: "Hey Dude", value: "dude"}
If you want to multiselect as a replacement for a select tag, just select this using jQuery selector and apply multiselect, it will work like magic!
Examples
Simple usage
With Autocomplete
More results on Autocomplete
Disable new options
Creating from a select