Html 下拉框和组合框有什么区别吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2176297/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there any difference between drop down box and combo box?
提问by Rakesh Juyal
Is there any difference between drop down box and combo box [ HTML ]?
下拉框和组合框 [ HTML ] 之间有什么区别吗?
Actually the point is, everytime i say something like: "there is some problem with the combo box", my senior says: "that's not a combo box that is a drop down", :)
其实重点是,每次我说:“组合框有问题”时,我的前辈说:“那不是一个下拉组合框”,:)
回答by Pekka
Technically, there are no combo boxes in HTML, because the <SELECT>
can't be typed into. See the Wikipedia article on Combo Box(emphasis mine):
从技术上讲,HTML 中没有组合框,因为<SELECT>
无法输入。请参阅关于组合框的维基百科文章(重点是我的):
A combo box is a commonly-used graphical user interface widget. It is a combination of a drop-down list or list box and a single-line textbox, allowing the user to either type a value directly into the control or choose from the list of existing options.
组合框是一种常用的图形用户界面小部件。它是下拉列表或列表框和单行文本框的组合,允许用户直接在控件中键入值或从现有选项列表中进行选择。
While the definition of drop-down listmatches exactly what the HTML <SELECT>
element does:
虽然下拉列表的定义与 HTML<SELECT>
元素的功能完全匹配:
When activated, it displays (drops down) a list of values, from which the user may select one.
激活后,它会显示(下拉)一个值列表,用户可以从中选择一个。
So your senior is right.
所以你的前辈是对的。
回答by Gishu
I guess he is getting at the fact
我猜他明白了这个事实
- a combo box is a combination of an input text field and a list of options. You can type in stuff in the input field and the list should update to highlight a possible match
- a dropdown is just a list of options that drops down when you click on the arrow button. You can only choose from a list of predefined options
- 组合框是输入文本字段和选项列表的组合。您可以在输入字段中输入内容,列表应更新以突出显示可能的匹配项
- 下拉列表只是当您单击箭头按钮时会下拉的选项列表。您只能从预定义选项列表中进行选择
回答by rajesh
The combobox allows the user to pick a value from a predefined set or input a custom one. The dropdownlist only allows picking one of the predefined values.
组合框允许用户从预定义的集合中选择一个值或输入一个自定义的值。下拉列表只允许选择预定义值之一。
回答by Stephen Graham
A combo box should have more than one item on a predefined list always visible to the user and should either:
组合框应在预定义列表中包含多个始终对用户可见的项目,并且应该:
enable users to select a single item from the predefined list and/or type their own value;
使用户能够从预定义列表中选择单个项目和/或键入他们自己的值;
or
或者
enable users to select multipleitems from a displayedpredefined list and/or add their own value
使用户能够从显示的预定义列表中选择多个项目和/或添加自己的值
A drop-down/drop-list box should only display and enable users to select oneitem from a predefined list.
下拉/下拉列表框应仅显示并允许用户从预定义列表中选择一项。