This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I have 2 drop down lists A and B. The drop down list B must only be activated when from drop down A option 1 is chosen (for all other options chosen list B must be inactive). I have implemented this by calling a js function when list A changes as below:
This works just fine, but there is one scenario where it does not. This happens when the user selects option 1 from list A - this enables list B and the user can select an option there too. However after processing the request when the form posts back, list A still shows option 1 selected - but list B is disabled. The user then needs to change list A and reselect option 1 only then list B becomes active. So I need to also run my js function when the form posts back everytime - does anyone know how I can do this?