title: ajaxform() & sortable('serialize'), and codeigniter .. submitting form fields and list elements
body: <p>i have a form and a sortable() list where a user can drag from a pre populated list, into an empty UL. The user would drag the LIs that they want into to this empty UL.. There is also a form with a few text boxes that the user fills out and clicks submit. </p>
  
  <p>I can get the ajaxform to submit the form data and display it in a flashdata session, but i cant get it to show the allowed_fields data. (which is the sortable list). I know its serializing it because running <code>alert(serializedList);</code> returns the serialized list of elements.</p>
  
  <p><strong>This is the JS to generate the sortable lists:</strong></p>
  
  <pre><code>/**
   * sortable ul items
   * 
   * this is used for the add levels page to associate allowed_fields 
   * to a level.
   */
  $('.block-list').sortable({
      connectWith: '.block-list',
      placeholder: 'placeholder'
  });
  </code></pre>
  
  <p><strong>This is the JS to process the ajaxSubmit:</strong></p>
  
  <pre><code>/**
   * showResponse(data)
   * show the response if the form submission is successful
   * @param  {object} data object of message or success
   * @return {null}
   */
  function showResponse(data){
      alert(serializedList);
      if (data.errorStatus == 1){
          $.jGrowl(data.message, { theme: 'error' });
      }else{
  
          $.jGrowl(data.message, { theme: 'success' });
      }
  }//end showResponse()
  
  /** @type {Object} setup the options for the ajax submit forms. */
  var submitOptions = {
      success: showResponse,
      beforeSubmit: function(){ serializedList = $("#allowed-fields-list").sortable('serialize');  },
      dataType: 'json',
      resetForm: true ,
      data: { allowed_fields: serializedList }
  };      
  $("#addlevel-form").ajaxForm(submitOptions);
  </code></pre>
  
  <p><strong>and this is the code igniter function that will handle the form data..</strong></p>
  
  <pre><code>public function addlevelprocess(){
      $message = array(
          'message' =&gt; 'Successfully Added The Level To The Database! WHOA!:'.$this-&gt;input-&gt;post(),
          'errorStatus' =&gt; 0
      );
      $this-&gt;session-&gt;set_flashdata('post', $this-&gt;input-&gt;post());
      echo json_encode($message);
  }
  </code></pre>
  
  <p>how can i get ajaxform to send both form field data and the sortables() data.</p>