Dynamic dropdown menu

Hi
I have two drop down menus I want the first one has name of the folders and when change the other dropdown has names of the sub-folders of this folder

i have the top folders at the first dropdown
how can i have the subfolders at the second when change first?

any help?

the problem is how to open folder

if i have folders

aaaaa has subfolders(1111,2222,2233)
bbbbb has subfolders(3333,4422,2433)
ccccc has subfolders(1131,2232,2532)

and each folder has subfolders how can i have name of these subfolders when change the topfolders(aaaaa,
bbbbb,
ccccc)

I have more than 1000 top folders and eachone have 10 subfolders
already i have all topfolders at first dropdown ,i want to have subfolders at second automatic ,