jQuery table filter with textbox and checkbox combined ('and' operation)
<p>Hi everyone I am very new to jQuery, I am trying to achieve table filter with textbox and checkbox. i google and found some pointers, i have created a function which can search using textbox and checkbox, but i am not able to combine as 'textbox and check box'. below is my code with help of other genius programmers.</p>

<pre><code>$(document).ready(function(){
    // Write on keyup event of keyword input element
    $("#kwd_search").keyup(function(){
        // When value of the input is not blank
        if( $(this).val() != "")
        {
            // Show only matching TR, hide rest of them
            $("#sortable_example tbody&gt;tr").hide();
            $("#sortable_example td:contains-ci('" + $(this).val() + "')").parent("tr").show();
        }
        else
        {
            // When there is no input or clean again, show everything back
            $("#sortable_example tbody&gt;tr").show();
        }
    });




    $(':checkbox').click(function () {
    var checkValues = $('input[type=checkbox]:checked').map(function() {
        return $(this).parent().text();
        }).get();

        //alert(checkValues);

        if( checkValues != "")
        //if($("td:eq(0)").text()==checkValues
        {
            // Show only matching TR, hide rest of them
            $("#sortable_example tbody&gt;tr").hide();
            for (var i=0; i &lt;checkValues.length; i++){
            $("#sortable_example td:nth-child(1):contains-ci('" + checkValues[i] + "')").parent("tr").show();
            }
        }
        else
        {
            // When there is no input or clean again, show everything back
            $("#sortable_example tbody&gt;tr").show();
        }
    });




});
// jQuery expression for case-insensitive filter
$.extend($.expr[":"], 
{
    "contains-ci": function(elem, i, match, array) 
    {
        return (elem.textContent || elem.innerText || $(elem).text() || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) &gt;= 0;
    }
});
</code></pre>

<p>it works perfectly fine separate, but if i have check box selected and try typing in text box it clears up check box filter and shows me the selection based on text box and vice versa. i am looking for the result of combined filter.</p>

<p>thanks in advance.</p>
