title: JQuery and MVC: Get Row(values) Based on CheckBox Selected
body: <p>I've got a table with row data.  Each row has a checkbox that will flag that row for processing.  The table is populated with the aid of a DisplayTemplate as can be seen in the below code. When the user clicks the "Process" button, the code should iterate the table and add all selected rows to an array that will be sent to a web service.  I thought this would be a simple thing to find an example on, but this hasn't been the case.</p>
  
  <p>This is the table:</p>
  
  <pre><code>&lt;table id="hes" class="table-striped table-condensed table-bordered"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;&lt;/th&gt;
                  &lt;th&gt;Detail Id&lt;/th&gt;
                  &lt;th&gt;Detail Reason Code&lt;/th&gt;
                  &lt;th&gt;Detail Status Code&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              @if (Model.HesViewModels != null)
              {
                  @Html.DisplayFor(i =&gt; i.HesViewModels)
              }
          &lt;/tbody&gt;
  </code></pre>
  
  <p></p>
  
  <p>I'm using this JQuery code to get the selected row and can't figure out how to get the row and it's corresponding values into an array.</p>
  
  <pre><code>$('#process').click(function () {
              var x = $('#hes tr').find('input[type="checkbox"]:checked').each(function () {
                 // GET THE VALUES OF THE TDs ON THIS ROW AND STICK IN AN ARRAY
              });
          });
  </code></pre>
  
  <p>EDIT - Here's what the rendered source looks like for each row:</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;&lt;input data-val="true" data-val-required="The Process field is required." id="HesViewModels_0__Process" name="HesViewModels[0].Process" type="checkbox" value="true" /&gt;&lt;input name="HesViewModels[0].Process" type="hidden" value="false" /&gt;&lt;/td&gt;
      &lt;td&gt;500116&lt;/td&gt;
      &lt;td&gt;0&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>