Jump to content

Multiple drop down


wallace45

Recommended Posts

Not sure if this has been asked before. I was given this task to make the product categorized according to size, car year, trim, etc. Ex. show results on Moto Metal wheels sizes that will fit selected a certain model of trucks. Like those on Tirerack: http://www.tirerack.com/content/tirerack/desktop/en/wheels.html

 

Any tips or lead will be appreciated. TIA

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

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.