Jump to content
wallace45

Multiple drop down

Recommended Posts

You will want to implement an AJAX solution. This is sometimes called a "chained select" implementation. You can google that for some possible solutions. Here are the basics.

 

  • Implement JavaScript triggers on the Select lists that are parents for the onChange event
  • Whenever a parent select list is changed call a function to:
  • Pass the currently selected value via AJAX to get the list of applicable options for the immediate child select list
  • Empty out the options from the child and grandchildren select lists, then replace the options for the immediate child element

You need to decide whether you want a "select one" as the default option when populating the options of a child element (I would) or if you want to default to the first valid value. If you do the latter, you need to run the same process on that child element, and the next (recursively), until all parent/child elements are run.

Edited by Psycho
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.