I have a menu structure system in the sidebar.

Head1
subhead1
subhead2
Head2
subhead1
subhead2
subhead3
subhead4
Head3

The subhead maintenance page has two pull down fields and two text fields. The two text fields are simply the page name and the page content. The first pulldown is to be used as a selector for the Head and the second is a selector for the subhead position under the parent. My question is this...

If I were to reassign subhead1 under head1 to now be placed as head2/position3, considering that the positional pulldown currently on the form has two positions for Head1, how would I actively update the positional pulldown to correctly display positions 1,2,3,4,&5 for Head2 immediately after selecting the new head?

Although I really do not know when to test I am thinking that I can create a variable before the change ($valueold=currentvalue) and then test $valueold to the new current value. If different and there are no other subheads (Head3 above) then I can put my current $_POST (???) values into perhaps a session cookie, redirect the page to itself, and then read the values back into the form from the cookie. Does the POST variable work like this? Does it change immediately after input but before submission? Am I thinking in the right direction?