title: jquery sortable, update ordering field
body: <p>I am trying to use jquery sortable and when an item is moved, it then updates the hidden ordering field? Has anyone done this before? I've tried a few different things but it's not passing through the current order of the item.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>jQuery(document).ready(function() { 
    jQuery(".sortable").sortable({ 
      opacity: 0.6, 
      cursor: 'move',
      update: function(event, ui) {
        var ordering = $(this).sortable('toArray').toString();
        alert(ordering);
      }
    });
  }); 
  </code></pre>
  
  <p>And here's the sortable part of my table:</p>
  
  <pre><code>&lt;tbody class="sortable ui-sortable"&gt;
    &lt;tr&gt;
      &lt;td width="5" align="center" class="cols sort"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td align="left"&gt;&lt;a onclick="getUsrInfo(1)" class="__productTBLink"&gt;&lt;strong&gt;Leanne Seawright&lt;/strong&gt;, Web Designer &lt;span class="__rowShowInfo"&gt;- view info.&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;td width="20" align="center"&gt;&lt;a class="__productTBLink" onclick="javascript:confdelete(1);"&gt;&lt;img width="16" height="16" align="left" title="Delete - click to delete this user" alt="Edit" src="/templates/manufacturers/images/delete.png"&gt;&lt;/a&gt;&lt;input type="text" value="1" id="ordering[1]" name="ordering"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td width="5" align="center" class="cols sort"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td align="left"&gt;&lt;a onclick="getUsrInfo(2)" class="__productTBLink"&gt;&lt;strong&gt;George Jetson&lt;/strong&gt;, Driver &lt;span class="__rowShowInfo"&gt;- view info.&lt;/span&gt;&lt;/a&gt;&lt;input type="text" value="2" id="ordering[2]" name="ordering"&gt;&lt;/td&gt;
      &lt;td width="20" align="center"&gt;&lt;a class="__productTBLink" onclick="javascript:confdelete(2);"&gt;&lt;img width="16" height="16" align="left" title="Delete - click to delete this user" alt="Edit" src="/templates/manufacturers/images/delete.png"&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>I just want the input field "ordering" to be updated when the item is moved using jquery sortable.</p>
  
  <p>Thanks in advance :)</p>