Multi Level Filter using in a CheckBox using JavaScript
<p>I have a check box list which filters the results.
with Options :</p>

<blockquote>
  <p>Spa(7) <br/>Bar(3) <br/>Spa/Bar(4)</p>
</blockquote>

<p>The values in brackets(7,3,4) respectively indicates the total Rooms having the mentioned facility.
When I select Spa, then my desired list should display only  7 results(I have 7 rooms with Spa Facility)
When I select Bar, then my desired  list should display only  3 results(I have 3 rooms with BarFacility)
When I select Spa/Bar, then my desired list should display only  4 results(I have 4 rooms with Spa/Bar)</p>

<p>If I select Spa/Bar and Spa both then I should get only 4 results.
If I select Spa/Bar and Bar both then I should get only 3 results.</p>

<p>The problem I am facing :
When i am selecting Spa/Bar and Spa , then I am getting 7 results.</p>

<p>Code :</p>

<pre><code> var selectedthemes = themes.split(',');
    var hotelThemes = '';
    var isThemeExist = false;
    for (var j = 0; j &lt; e.HTName.length; j++) {
    if (e.HTName[j].HTName != null &amp;&amp; typeof (e.HTName[j].HTName) != 'undefined')
    hotelThemes += (hotelThemes != "" ? "," : "") + 
    $.trim(e.HTName[j].HTName.toLowerCase());
    }

    for (var i = 0; i &lt; selectedthemes.length; i++) {
    if (hotelThemes.indexOf($.trim(selectedthemes[i].toLowerCase())) &gt;= 0)
    { isThemeExist = true; }
    else
    { return false; }
    }

    return isThemeExist;
</code></pre>
