dropbox/select box display depends on another dropbox

dropbox/select box display depends on another dropbox

My requirement is that whether a dropbox (select box) is displayed depend on another dropbox's state/value.
e.g. When the country is US, the state is displayed; when the country is Canada, the province is displayed.
i.e. The user choose the country, then the corresponding state or province will be displayed.
Is there any sample code or tutorial to do that?