Good Morning Friends;
I am using a JQuery script to act as a filter on a custom list. The text in my custom list is all Uppercase. Currently the filter is case sensitive. I tried using text-transform to uppercase, which indeed transforms the text in the box. However, the filter still will not work unless CAPS Lock is on, on my keyboard.
Any help would be appreciated.
<SCRIPT type="text/javascript"src="SiteAssets/Scripts/jquery.min.js"></SCRIPT>
<SCRIPT type=text/javascript>
jQuery(document).ready(function($){
//attach a function to the keyup event on the filter box
$('#filterInput').keyup(function()
{
var inputVal = $('#filterInput').val():
DynamicFilter(inputVal.toUpperCase());
});
})
//strip off html taqs
function stripHTML (field) {
return field.replace(/<([^>]+)>/g,'');
}
function DynamicFilter(text)
{
//find out list view (default class for a listview is "ms-listviewtable"
$('table [class="ms-listviewtable"]').find('tr').each(function()
{
//don't filter out the header row
if ($(this).attr("class") != "ms-viewheadertr ms-vhltr")
{
//get the html for the row and strip off the html tabs
source = stripHTML($(this).html());
//check to see if the filter text exists in the remaining text
if (source.indexOf(text) < 0)
{
//hide the row if it doesn't contain the text
$(this).hide();
} else {
//otherwise show it
$(this).show();
}
}
}
);
}
</script>
<div id="mainDiv">
<table>
<tr>
<td class='Filter' width='125px'>Search: <input type="Text" id="filterInput" ></td>
</tr>
</table>
</div>