简体   繁体   English

几个可配置的下拉列表

[英]Several Configurable Drop Down Lists

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. 我在http://www.javascriptsource.com/forms/dynamic-drop-down-list.html尝试了该脚本,并花了6个小时试图使其对我有利,但我得出的结论是肯定做错了,需要帮助。

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. 这是一个允许用户自己构建PC的项目,但是由于主板具有某些限制(例如RAM数量或CPU余量)的事实,容纳RAM / CPU的下拉列表必须适应所选的主板等

A basic layout I have in mind is; 我想到的基本布局是:

Please choose a Class 请选择一个班级

[Dropdown 1 "Class"] [下拉菜单1“类”]

  • Ultimate 最终
  • High
  • Medium 介质
  • Low

[Dropdown 2 "Motherboard"] [下拉菜单2“主板”]

  • Content 内容

[Dropdown 3 "RAM"] [下拉3“ RAM”]

  • Content 内容

[Dropdown 4 "CPU"] [下拉4个“ CPU”]

  • Content 内容

[Dropdown 5 "Optical Drives"] [下拉5个“光盘驱动器”]

  • Content 内容

[Dropdown 6 "Hard Drives"] [下拉6个“硬盘”]

  • Content 内容

[Dropdown 7 "Chassis"] [下拉菜单7“机箱”]

  • Content 内容

[Dropdown 8 "Power Supply"] [下拉菜单8“电源”]

  • 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. 等等,因此,假设您的主板仅支持8GB RAM,则RAM子下拉列表将显示选项2GB,4GB和8GB,但不显示其他选项,例如16GB或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. 下拉菜单不应仅被锁定为1个下拉菜单,而应在整个过程中保持灵活,以防主板/ CPU /内存不兼容,因此需要锁定某些项目。

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. 如果有人可以帮助我,我将不胜感激,甚至将我引向完成上述目标的类似项目的方向。

I believe this is what you're looking for: 我相信这就是您要寻找的:

Chained Select Menu 链接选择菜单

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM