title: post table data to MVC action using ajax
body: <p>Hi I have a web page with some input field and the datatable to handle some client-side actions. I am using ASP MVC to control the server side process and i am quite stuck at how I can submit the form with some fields in the datatable.</p>
  
  <p>Simply, my page is like below.</p>
  
  <pre><code>&lt;form id="formID" action="test" class="form-horizontal"&gt;
      &lt;select class="form-control valid" data-val="true" id="SelectedCustomerID" name="SelectedCustomerID"&gt;
          &lt;option value=""&gt;choose customer ... &lt;/option&gt;
          &lt;option value="1"&gt;test&lt;/option&gt;
      &lt;/select&gt;
  
      &lt;table&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;input type="number" name="row-1-input1" id="row-1-input1" class="input-xs" value="2"&gt;
                  &lt;input type="number" name="row-1-input2" id="row-1-input2" class="input-xs" value="test"&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;input type="number" name="row-2-input1" id="row-2-input1" class="input-xs" value="3"&gt;
                  &lt;input type="number" name="row-2-input2" id="row-2-input2" class="input-xs" value="test2"&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  
      &lt;button type="submit" class="btn yellow-gold add"&gt;add&lt;/button&gt;
  &lt;/from&gt;
  </code></pre>
  
  <p>I am struggling with how I can submit this form and pass all the input fields to handle the input fields in the table. </p>
  
  <p>How can I use ajax to submit the form and pass all these input fields and how this can be mapped with the MVC model ? </p>
  
  <pre><code>$('#formID').on('submit', function (e) {
          e.preventDefault();
          $.ajax({
              type: 'POST',
              url: '/pathTo/process_form',
              data: &lt;---- what needs to go here ... ?
          });
      });
  </code></pre>