0

i found this fiddle.., it works fine but can anyone know how to remove the case sensitivity in it.? thank you newbie here, any help is appreciated ^^

http://jsfiddle.net/ukW2C/3/

$("#searchInput").keyup(function () {
//split the current value of searchInput
var data = this.value.split(" ");
//create a jquery object of the rows
var jo = $("#fbody").find("tr");
if (this.value == "") {
    jo.show();
    return;
}
//hide all the rows
jo.hide();

//Recusively filter the jquery object to get results.
jo.filter(function (i, v) {
    var $t = $(this);
    for (var d = 0; d < data.length; ++d) {
        if ($t.is(":contains('" + data[d] + "')")) {
            return true;
        }
    }
    return false;
})
//show the rows that match.
.show();
}).focus(function () {
    this.value = "";
   $(this).css({
    "color": "black"
});
$(this).unbind('focus');
}).css({
"color": "#C0C0C0"

});

Yogesh
  • 4,546
  • 2
  • 32
  • 41

1 Answers1

0

Use toLowerCase()

jo.filter(function (i, v) {
    var $t = $(this);
    for (var d = 0; d < data.length; ++d) {
        console.log( (data[d]).toLowerCase() );
        if ($t.is(":contains('" + data[d].toLowerCase() + "')")) {
            return true;
        }
    }
    return false;
})
jogesh_pi
  • 9,762
  • 4
  • 37
  • 65