Javascript show multiple table rows from multiple select -
i code show multiple table rows depending on user selects in multiple select item. code shows last selected item reason, please me? code is:
if(list[x].selected) { $('table#newspaper-a tr:not(#header, #trweeknummer)').hide(); $('table#newspaper-a tr:not(#header, #trweeknummer)').each(function(){ $('td:nth-child(1)',this).each(function(){ if($(this).text() == list[x].value) $(this).parent(this).show(); }); }); }
i have fixed problem myself, solution was:
$('table#newspaper-a tr:not(#header, #trweeknummer)').hide(); if(list[x].selected) { $('table#newspaper-a tr:not(#header, #trweeknummer)').each(function(){ $('td:nth-child(1)',this).each(function(){ if($(this).text() == list[x].value) $(this).parent(this).show(); }); });
}
Comments
Post a Comment