title: Convert serialize() to array of objects to post to controller
body: <p>I am using Datatables. I have a table with multiple inputs and I want to post array of objects to controller via ajax. </p>
  
  <pre><code>var data = table.$('input, select').serialize();
  </code></pre>
  
  <p>The result:</p>
  
  <pre><code>row-1-location=123&amp;row-1-lot=231545&amp;row-2-location=2323&amp;row-2-lot=5523&amp;row-3-location=23232&amp;row-3-lot=23235
  </code></pre>
  
  <p>I am assuming I need to split the string at every second '&amp;', then split again.
  The question is, is this the only way to convert it to array of objects?</p>
  
  <p>The result I want is array of objects:</p>
  
  <pre><code>[{location : 123, lot: 231545}, {location: 2323, lot: 5523}......]
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;tbody&gt;
      &lt;tr role="row" class="odd"&gt;
          &lt;td&gt;&lt;input type="text" id="row-5-location" name="row-5-location" value=""&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" id="row-5-lot" name="row-5-lot" value=""&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr role="row" class="even"&gt;
          &lt;td&gt;&lt;input type="text" id="row-6-location" name="row-5-location" value=""&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" id="row-6-lot" name="row-5-lot" value=""&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>Thanks!</p>