title: Javascript filtering on keyup
body: <p>Here is my current HTML table:</p>
  
  <pre><code>&lt;table class="table table-index"&gt;
      &lt;thead&gt;
          &lt;tr class="filters"&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control company-id" placeholder="ID"&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control" placeholder="Organization"&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control" placeholder="Contact"&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control" placeholder="Title"&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control" placeholder="City"&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control" placeholder="State"&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control" placeholder="email"&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control" placeholder="contacted"&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control" placeholder="hiring"&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input type="text" id="search_table" class="form-control" placeholder="hire_count"&gt;&lt;/th&gt;
              &lt;th&gt;
                  &lt;div class="checkbox-inline"&gt;
                      &lt;input type="checkbox" id="checkbox1" class="large" data-label-prepend="prefix"&gt;
                          &lt;label for="checkbox1"&gt;Contacted&lt;/label&gt;
                  &lt;/div&gt;
               &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
  
  
      &lt;tbody&gt;
          &lt;% @companies.each do |company| %&gt;
          &lt;tr&gt;
              &lt;td class="id"&gt;&lt;%= company.id %&gt;&lt;/td&gt;
              &lt;td class="Organization"&gt;&lt;%= link_to company.organization,
                      admin_company_path(company.id) %&gt;&lt;/td&gt;
              &lt;td class="contact"&gt;&lt;%= company.name %&gt;&lt;/td&gt;
              &lt;td class="contact-title"&gt;&lt;%= company.title %&gt;&lt;/td&gt;
              &lt;td class="city"&gt;&lt;%= company.city %&gt;&lt;/td&gt;
              &lt;td class="state"&gt;&lt;%= company.state %&gt;&lt;/td&gt;
              &lt;td class="email"&gt;&lt;%= company.email %&gt;&lt;/td&gt;
              &lt;td class="contacted"&gt;&lt;%= company.status %&gt;&lt;/td&gt;
              &lt;td class="hiring"&gt;&lt;%= company.hiring %&gt;&lt;/td&gt;
              &lt;td class="hire_count"&gt;&lt;%= company.hire_count %&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;% end %&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Here is my <code>table_filtering.js</code> file:</p>
  
  <pre><code>$(document).ready(function() {
      if ($(".table-index").length &gt; 0 ) {
          $('#search_table').keyup(function() {
              searchByColumn($(this).val());
          });
  
          function searchByColumn(searchVal) {
              var table = $('.table-index')
              table.find('tr').each(function(index, row){
                  var allDataPerRow = $(row).find('td');
                  if (allDataPerRow.length &gt; 0) {
                      var found = false;
                      allDataPerRow.each(function(index, td) {
                          var regExp = new RegExp(searchVal, "i");
  
                          if(regExp.test($(td).text())) {
                              found = true
                              return false;
                          }
                    });
  
                    if(found === true) {
                        $(row).show();
                    }else {
                        $(row).hide();
                    }
                  }
              });
          }
      }
  });
  </code></pre>
  
  <p>The problem is that I'm only filtering by the first <code>$("#search_table")</code> which is the ID column but I'm not filtering by any of the text boxes. What can I do so that all of the text boxes are filtering? I also want users to be able to filter by multiple text boxes. So if a user puts in input in the city and title, results only by the city and title will show.</p>
  
  <p>Also, is my current filtering compatible with will_paginate? Meaning... will results on other pages be searched through?</p>