Passing variables to a function using a button and submittin

I am attempting to setup a multiple select box page that has 1 master select box and a dynamic number of child ones.For example: I have 10 territories and within those 10 territories can be 100 counties....