I am using a chained select-menu to guide the visitor trough some questions. This works like a charm, however, in the end the user has to click a button to send all values to a PHP-script. This also works without a problem, however, when the page reloads (because the button sends the form to the same page), all fields are hidden again and this is not what i want.

I would like the chained selection menu's to be shown when items in them are "selected" when the page reloads. Using PHP i simply test if a field was selected and add that status to the select-menu. But they remain hidden until you manually select everything again.

I think it's just a minor adjustment in the JS-part. But my limited knowledge of JS leaves me without a solution.

jsFiddle
Chainedselection script
jQuery UI and selectmenu

I also posted this question on StackOverflow, but lately I am not getting any answers for any questions on this site. So I am trying it elsewhere as well. I ofcoarse will post the answer wherever someone helps me.