I have a filter code which is working fine if i give a single value , but i have more than 100+ values in my table, and i have to search for two or three value in the table at same time, so i planned to use comma for that, like in a single search box i will write the values i have to search in a table column in a comma separated fashion.
SO currently it is working, but it is not filtering when i give comma, Since am new to this scripting and web development, Can anyone help me.
$('#tblfiles').dataTable({
"search": {
"smart": true,
"regex": true
}
});
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script>
<div id="nam"></div>
<br>
<table id="tblfiles">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Country</th>
<th>StDID</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>pooe</td>
<td>country1</td>
<td>Sgyt13</td>
</tr>
<tr>
<td>2</td>
<td>AAA</td>
<td>country2</td>
<td>P5372</td>
</tr>
<tr>
<td>3</td>
<td>BBB</td>
<td>country3</td>
<td>P5972</td>
</tr>
</tbody>
</table>
So here i have to fetch rows which contain Name as AAA and BBB, so instead on searching and getting value one by one, in search bar i have to give AAA, BBB .. so that it will fetch both corresponding rows to me.
So here it replaces the first % but not the second
