title: Passing list item value during JQuery sortable() function
body: <p>I'm trying to pass information from an unordered list, list item to an ajax request once the list item is placed in another list. </p>
  
  <p>This is the JQuery that picks up the column #id the list item is dropped into, however the code for getting the $row['id'] picks up the first item in each list, not the specific item I'm sorting. </p>
  
  <p>(I'm using php to iterate the list items in both lists - I've removed the unessential PHP code).</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
  
  $(".sortable").sortable({
  
  connectWith : ".sortable",
  receive  : function(){
  
           var column = $(this).closest('div.box').attr('id');
           var id = $(this).find('span').html(); 
  
           $.ajax({
                   url: "update_column.php",
                   type:"POST",
                   data: "column="+column+"&amp;id="+id
                  });
  
           alert(column + id)
  
                   }
  
  })
  .disableSelection();
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm using the alert() to give me some visual feedback. This is the HTML code:</p>
  
  <pre><code>    &lt;div id="one" class="box"&gt;
      &lt;ul class="sortable"&gt;
  
  
           &lt;li&gt;
           &lt;div class="card"&gt;
           &lt;p&gt;' . $row['customer'] . '&lt;/p&gt;
           &lt;p&gt;' . $row['ponumber'] . '&lt;/p&gt;
           &lt;p class="hide"&gt;&lt;b&gt;ID:&lt;/b&gt;&lt;span&gt;' . $row['id'] . '&lt;/span&gt;&lt;/p&gt;
           &lt;p class="hide"&gt;' . $row['misc'] . '&lt;/p&gt;
           &lt;/div&gt;
           &lt;/li&gt;       
  
  
  
      &lt;/ul&gt;
      &lt;/div&gt;   
  
      &lt;div id="two" class="box"&gt;
      &lt;ul class="sortable"&gt;
  
  
           &lt;li&gt;
           &lt;div class="card"&gt;
           &lt;p&gt;' . $row['customer'] . '&lt;/p&gt;
           &lt;p&gt;' . $row['ponumber'] . '&lt;/p&gt;
           &lt;p class="hide"&gt;&lt;b&gt;ID:&lt;/b&gt;&lt;span id="id"&gt;' . $row['id'] . '&lt;/span&gt;&lt;/p&gt;     
           &lt;p class="hide"&gt;' . $row['misc'] . '&lt;/p&gt;
           &lt;/div&gt;
           &lt;/li&gt;
  
  
  
  
  
  
      &lt;/ul&gt;
      &lt;/div&gt;   
  </code></pre>
  
  <p>I'm a self taught programmer who has been programming for 3 months so I apologise for any novice mistakes.</p>