I wrote a tutorial that shows how to build two select boxes in JavaScript where values in the one depend on the value in the other.