html表单下拉菜单
Drop-down menus are used on forms to capture responses for which there is one correct response from multiple possible answers. A good example of this is asking for a visitor’s province, state or country.
表单上使用下拉菜单来捕获响应,对于这些响应,可以从多个可能的答案中获得一个正确的响应。 一个很好的例子就是要求访问者所在的省,州或国家。
考虑替代方案 (Considering Alternatives)
It's important to consider all the possibilities when making a form. We could simply present a textbox in which the user could type the province name, but that allows the possibility that they could make a typing mistake (which becomes an issue if this information is entered directly into a database, without human oversight). We could reduce the size of the textbox to to allow just two characters, and prompt the user just to type in the province or state abbreviation: while that reduces the possibility of error, it does not remove it.
制作表格时,必须考虑所有可能性。 我们可以简单地显示一个文本框,用户可以在其中输入省名,但是这允许他们可能会键入错误(如果将此信息直接输入到数据库中而没有人为监督,则会成为问题)。 我们可以将文本框的大小减小为仅允许两个字符,并提示用户仅输入省或州的缩写:虽然这会减少出错的可能性,但不会将其删除。
One of the best solutions to use for a question in a form for which there is only one right answer from a large number of possibilities is a drop-down menu.
下拉菜单是在多种可能性中只有一个正确答案的形式中用于问题的最佳解决方案之一。
下拉标记 (Drop-down Markup)
In an HTML form, this is created through the use of the <select>
tag.
在HTML表单中,这是通过使用<select>
标记创建的。
As always, we place our