I'm using Jqueryui connected sortable lists and I would like to drop elements only when the connected list is empty, so I have to force the user to add maximum 1 element. Using Jquery droppable is not allowed.
So, How can I manage JQueryui connected list to restrict the number of elements inside? I want sortable1 and sortable2 to accept only one element from sortable0.
<ul id="sortable0" class="connectedSortable">
<li> word1 </li> <li> word2 </li> <li> wordN </li>
</ul>
<ul id="sortable1" class="connectedSortable"> </ul>
<ul id="sortable2" class="connectedSortable"> </ul>
$(function() {
$( "#sortable0, #sortable1, #sortable2" ).sortable({ connectWith: ".connectedSortable" });
});
Thanks in advance.