We've seen how to connect lists to form a <ul>
tree, but what if we want to just drag items from one list to another?
It's actually exactly the same. In the previous example, the lists were contained within each other, but in this case, it's a lot more obvious.
Let's say you want to create a simple emailer, which will take a list of your contacts and will email only the ones that you select.
You could do this with multi-select boxes or check boxes, but it looks nicer when you can drag the selected items into a list. You can then see the complete list a lot more clearly.
So first off, let's create the HTML.
Create a file called connecting-lists.php
, and place this in it:
<?php session_start(); if(!isset($_SESSION['contacts'])) $_SESSION['contacts']=array(); ?> <html> <head> <script src="../jquery.min.js"></script> <script src="../jquery-ui.min.js"></script> <script src="connecting-lists...