Good day! I'm having trouble with searching in jquery dataTable search bar for the string word 'Active'. If I change search bar the for the word 'Inactive'. The table will filter. However it does not seem to work with the string 'Active'.
When I search Inactive
When I search Active
Table code:
<table class="table table-hover table-bordered" id="table1">
<thead>
<tr>
<th>Faculty Code</th>
<th>Last Name</th>
<th>First Name</th>
<th>Middle Name</th>
<th>Position</th>
<th></th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php while ($row = $result -> fetch_object()): ?>
<tr>
<td><?php echo $row->Faculty_ID;?></td>
<td><?php echo $row->Faculty_Lastname ;?></td>
<td><?php echo $row->Faculty_Firstname ;?></td>
<td><?php echo $row->Faculty_Middlename;?></td>
<td><?php echo $row->Position; ?></td>
<td class="text-center">
<a class="btn btn-sm btn-outline-primary text-muted" href="Faculty_edit.php?Faculty_ID=<?php echo $row->Faculty_ID;?>">Edit</a>
<a data-fid="<?php echo $row->Faculty_ID;?>" title="Delete Faculty" data-toggle="modal" data-target="#delete_modal" class="btn btn-sm btn-outline-danger delete-faculty-btn text-muted" >Delete</a>
</td>
<td>
<?php if($row->Status=='Active') echo '<a href="#deactive_account" data-toggle="modal" data-id='.$row->Faculty_ID.' class="activate" style="color:green;">Active</a>'; ?>
<?php if($row->Status=='Inactive') echo '<a href="#active_modal" data-toggle="modal" data-id='.$row->Faculty_ID.' class="activate" style="color:red;">Inactive</a>'; ?>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
jQuery Code:
<script>
$('#table1').DataTable({
order: [],
columnDefs: [ { orderable: false, targets: [5] } ]
});
</script>