I have this JQuery Script that will supposedly look for each letters (or names of the Client from the List of Clients table) typed by the user on the searchbox.
<script>
$(document).ready(function() {
$("#search-value").on("keyup", function() {
var value = $(this).val();
$("table tr").each(function(index) {
if (index!==0) {
$x = $(this);
var id = $x.find("td:first").text();
if (id.indexOf(value)!==0) {
$x.hide();
}
else {
$x.show();
}
}
});
});
});
</script>
But the thing is, it only works for numbers, commonly IDs if the user searched for the clients' ID numbers instead. What I want is to make it work also, not just for IDs but the letters or preferable names typed by the users. BTW, this is just a follow up question of In-Page Result Search This is also similar to a JQuery Script given by one of this site's Q&A. And it seems to work fine either by letters or numbers. So I wonder what would be the problem when I installed it on my index page?