jQuery UI sortable on select options

Posted by user1038814 on Stack Overflow See other posts from Stack Overflow or by user1038814
Published on 2012-06-21T08:36:58Z Indexed on 2012/06/21 9:16 UTC
Read the original article Hit count: 189

I'm trying to get jQuery UI default sortable to work on options in a select multi list box but can't seem to get it working. Can this work with a select option? I've only seen examples with <li> everywhere.

Here's my JavaScript:

$(function() {
    $( "#secondSelectms2side__dx" ).sortable();
    $( "#secondSelectms2side__dx" ).disableSelection();
});

And the HTML:

<select title="" name="secondSelectms2side__dx" id="secondSelectms2side__dx" size="8" multiple="multiple">
    <option value="4">asdsdsds</option>
    <option value="10">bsdsdsdsd</option>
    <option value="2">csdsdsds</option>
</select>?

My code is on jsFiddle:

http://jsfiddle.net/noscirre/DRUPe/

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery