jquery multiselect selected data order

前端 未结 4 540
耶瑟儿~
耶瑟儿~ 2020-12-20 21:44

I am using jquery multiselct from this page http://loudev.com/. It works well but now the system requirements need this multiselect to past the data in the order that have

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-20 22:24

    This code reorders the selected options in the multiselect in the order that they are shown in the plugin. They will be in the right order when submitted.

    afterSelect: function(value){
            $('#countries option[value="'+value+'"]').remove();
            $('#countries').append($("").attr("value",value).attr('selected', 'selected'));
          },
    

提交回复
热议问题