I need help filtering a table row based on the values in two different columns. The idea is to show only the row where one column has "value1" and another column has "value2", while hiding all other rows. If none of the rows meet this condition, then hide them all.
Below is the jQuery code I have tried so far:
var firstDropVal = $('#first .fstselected').text(); // Value from the first dropdown
var secondDropVal = $('#second .fstselected').text(); // Value from the second dropdown
// 'rows' is the class of the table rows (tr)
var $rowsNo = $('.rows').filter(function() {
return $.trim($(this).find('td:visible').eq(0 && 1).text()) !== firstDropVal && secondDropVal
}).hide();
This is the HTML code for my table:
while($row = mysqli_fetch_array($result)) {
$i++;
echo "
<tr class='rows' id='rows".$i."'>
<td name='rows".$i."' id='hersteller".$i."' class='text-left'>".$row['Hersteller']."</td>
<td id='artikel".$i."' class='text-left'>".$row['Artikel']."</td>
<td id='mase".$i."' class='text-left'>".$row['Mase']."</td>
<td id='stuecke".$i."' class='text-left'>".$row['Stuecke']."</td>
<td id='herstellerkurz".$i."' class='text-left'>".$row['HerstellerKurz']."</td>
<td id='masekurz".$i."' class='text-left'>".$row['MaseKurz']."</td>
<td id='farbekurz".$i."' class='text-left'>".$row['FarbeKurz']."</td>
<td id='artikelnummer".$i."' class='text-left'>".$row['Artikelnummer']."</td>
</tr>
";