Jquery multiselect multi-select drop-down box code
$ "). Multiple options (oneormoreselected: '*', select ALL: false, noneselected: 'default display '));
Usage: $ ('# id '). Multiple choice (option, callback)
Option: Select All-show all options; true/false; default value: True
Selectalltext-text display select/deselect all options at the same time
Noneselected-the text to be displayed is not selected in the list
Oneormoreselected-text display when one or more projects are selected in the list
(Note: You can use a selected number of projects placeholder % ).
Use * to display all selected comma-separated lists. The default value is '% select'
Optgroups tutorial electable-whether optgroups is optional, if you use them, true/false, default = false
Listheight-this is the maximum height selected by droptdown
Use webpage special effects to set the default items in the Multi-choice box.
$ ("# Id"). attr ("value", ""); // clear the selected item.
Var ids = '1, 3, 6 '; // you can specify the id of the selected box.
Var id_ojbect = (ids). split (","); // split it into an ojbect array.
Var count = $ ("# id option"). length; // obtain the length of the drop-down box.
For (var c = 0; c <id_ojbect.length; c ++ ){
For (var c_ I = 0; c_ I <count; c_ I ++)
{
If ($ ("# id"). get (0). options [c_ I]. text = id_ojbect [c])
{
$ ("# Id"). get (0). options [c_ I]. selected = true; // set it to selected.
}
}
}
// Update the textbox with the total number of selected items, and determine select all
$ ("# Id"). updateselected ()
// Update the dropdown options
$ ("# Id"). multiselectoptionsupdate ()
// Hide the dropdown
$ ("# Id"). multiselectoptionshide ()
// Show the dropdown
$ ("# Id"). multiselectoptionsshow ()
// Get a coma-delimited list of selected values
$ ("# Id"). selectedvaluesstring