title: DataTables, filter multiple columns with multiple values
body: <p>The <a href="https://datatables.net/examples/api/multi_filter_select.html" rel="nofollow noreferrer">following page</a> gives an example on how to implement a filter by values on columns.</p>
  
  <p>I want to replace the <code>select</code> with a <code>multiple select</code>, so user can filter out more than one value for a specific column, however, I am unsure on how to process the multiple values received by the <code>multiple select</code>.</p>
  
  <pre><code>    $(document).ready(function() {
          $('#example').DataTable( {
              initComplete: function () {
                  this.api().columns().every( function () {
                      var column = this;
                      var select = $('&lt;select multiple&gt;&lt;option value=""&gt;&lt;/option&gt;&lt;/select&gt;')
                          .appendTo( $(column.footer()).empty() )
                          .on( 'change', function () {
                              var val = $.fn.dataTable.util.escapeRegex(
                                  $(this).val()
                              );
  
                              column
                                  .search( val ? '^'+val+'$' : '', true, false )
                                  .draw();
                          } );
  
                      column.data().unique().sort().each( function ( d, j ) {
                          select.append( '&lt;option value="'+d+'"&gt;'+d+'&lt;/option&gt;' )
                      } );
                  } );
              }
          } );
      } );
  </code></pre>
  
  <p>Specifically I would need to know what to do here when <code>this</code> is a multiple select.</p>
  
  <pre><code>var val = $.fn.dataTable.util.escapeRegex(
      $(this).val()
  );
  
  column
      .search( val ? '^'+val+'$' : '', true, false )
      .draw();
  </code></pre>