Guessing between the lines, is your problem: How to get the first list to display differently after selecting an item from it? - You'd need to resort the items in depts in your code, I'd guess.
(Sorry don't know much about HTML::Template, maybe someone else does, if you explain your question better).
C.
Comment on Re: Submitting form when drop down value changes