jquery - Multi Level Filter using in a CheckBox using JavaScript -


i have check box list filters results. options :

spa(7)
bar(3)
spa/bar(4)

the values in brackets(7,3,4) respectively indicates total rooms having mentioned facility. when select spa, desired list should display 7 results(i have 7 rooms spa facility) when select bar, desired list should display 3 results(i have 3 rooms barfacility) when select spa/bar, desired list should display 4 results(i have 4 rooms spa/bar)

if select spa/bar , spa both should 4 results. if select spa/bar , bar both should 3 results.

the problem facing : when selecting spa/bar , spa , getting 7 results.

code :

 var selectedthemes = themes.split(',');     var hotelthemes = '';     var isthemeexist = false;     (var j = 0; j < e.htname.length; j++) {     if (e.htname[j].htname != null && typeof (e.htname[j].htname) != 'undefined')     hotelthemes += (hotelthemes != "" ? "," : "") +      $.trim(e.htname[j].htname.tolowercase());     }      (var = 0; < selectedthemes.length; i++) {     if (hotelthemes.indexof($.trim(selectedthemes[i].tolowercase())) >= 0)     { isthemeexist = true; }     else     { return false; }     }      return isthemeexist; 


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -