0

I was searching for a drop down list script that auto-updates the content below the drop-down list in several sub-drop down lists derived from the choice made in the initial drop-down list selection.

I tried out the script at http://www.javascriptsource.com/forms/dynamic-drop-down-list.html and spent 6 hours trying to make it work in my favour, but I have come to the conclusion that I am definitely doing something wrong and would need help.

I would like to start off with a drop-down list that contains "Classes" of a computer that can be built. For instance; Ultimate, High, Mid, Low. When a user selects one of those options, the below drop-down unlocks, giving new options, and when that option is chosen the below updates, etc, etc till the last item which is the end of the form.

It is a project to allow a user to build a PC for themselves, but owing to the fact that a motherboard has certain limitations such as RAM amount or CPU allowance the drop-down that houses RAM/CPU would have to adapt to the motherboard chosen, etc.

A basic layout I have in mind is;

Please choose a Class

[Dropdown 1 "Class"]

  • Ultimate
  • High
  • Medium
  • Low

[Dropdown 2 "Motherboard"]

  • Content

[Dropdown 3 "RAM"]

  • Content

[Dropdown 4 "CPU"]

  • Content

[Dropdown 5 "Optical Drives"]

  • Content

[Dropdown 6 "Hard Drives"]

  • Content

[Dropdown 7 "Chassis"]

  • Content

[Dropdown 8 "Power Supply"]

  • Content

Etc. So when lets say you have a motherboard that only support 8GB of RAM, then the RAM sub-dropdown would show options 2GB, 4GB and 8GB, but not additional options such as 16GB or 32GB. The drop-down shouldn't be locked to just 1 drop-down, but be flexible throughout in case motherboard/cpu/ram incompatibilities and hence some items need to be locked out.

Perhaps make a list of items that can be made under category "Ultimate" and make my way down to "Low"?

If anyone could assist me with this, I would greatly appreciate it, even point me in a direction of a similar project of which the above has been accomplished.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Deadmano
  • 217
  • 1
  • 7
  • 15
  • Duplicate of http://stackoverflow.com/questions/6954556/show-a-second-dropdown-based-on-previous-dropdown-selection Also http://stackoverflow.com/questions/5686735/populate-one-dropdown-based-on-selection-in-another – sachleen Jun 27 '12 at 14:55
  • The term you're searching for is "Cascading Dropdowns." Do a Google search for it; you'll find boatloads of information on how to do it. – Robert Harvey Jun 27 '12 at 14:55
  • Thanks for the response! I have checked them out, but most support only a limited amount, and some without even the basic documentation. The one provided by Sean Johnson/sachleen is heavily documented and even comes with a config file making it even more easier. I've studied the config a bit, and seems quite straightforward so I'll see what I can do. Thanks to everyone for the assist thus far, and I'll try my best from here on out! If I get stuck hopefully one of you would kindly help me out. :) I'll be sure to update the outcome whichever way this goes. – Deadmano Jun 28 '12 at 07:52
  • I have managed to make the script work for me, however I would like to add an option where when the user selects an item a total at the bottom of the page will be updated, for each product, so the final choices are shown with the total and used in a form to send me the information. I found http://www.javascriptsource.com/forms/auto-sum-checkboxes.html however I have no idea how to implement it, any ideas? – Deadmano Jun 28 '12 at 13:05

1 Answers1

0

I believe this is what you're looking for:

Chained Select Menu

sachleen
  • 30,730
  • 8
  • 78
  • 73
Sean Johnson
  • 5,567
  • 2
  • 17
  • 22
  • 2
    How about providing some context, a brief summary of what is at the link? http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers – Robert Harvey Jun 27 '12 at 14:56
  • Thanks for the informative post, I'll keep that in mind in the future! :) – Sean Johnson Jun 27 '12 at 15:00