I have a table where each row has a category column and a sub-category column. I need to let the users chose a category to filter, and then only show the sub-categories that are related so they can filter further. I’m thinking it could be a select drop-down list and only show a second drop-down list when sub-categories exist. I’ve seen some examples that use server-side scripts (such as Remy Sharp’s solution http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax/) but I just need strictly a client-side jQuery solution. Anyone have suggestions on the best way to do this or examples of it?
Share
I like Dan’s idea, so I expanded on it (quite a bit). You should be able to paste this into a text editor and watch it work.
Basically, it’s using classes on the TRs to show and hide them, and using a larger number of hidden selects to show groups of subcategories.