如何在HTML选择框中的选项中添加说明? [英] How can I add descriptions to the options in an HTML select box?

查看:277
本文介绍了如何在HTML选择框中的选项中添加说明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找处理此用户界面问题的可能方法的建议.

I'm looking for suggestions of possible ways to handle this user interface question.

我有一个带有选择框的表单,用户可以在其中选择命名位置 从大量公司位置列表中.此列表中的某些选项具有相似或可能相同的名称,但对应于具有不同地址的位置.

I have a form with a select box drop down where a user is selecting a named location from a LONG list of company locations. Some of the options in this list have similar, or potentially identical names, but correspond to locations with different addresses.

例如,可能有选项:

ABC Company
ABC Company 2nd Floor
BEF INC
BEF INC West
...

我想做的是以某种方式为用户提供有关选择选项的更多信息,可以在选择框本身中,也可以作为悬停工具提示.

What I'd like to do is somehow give the user more info about the select option, either in the select box itself, or maybe as a hover-over tooltip.

理想情况下,我希望选择选项显示为:

Ideally, I'd like the select options to appear as:

ABC Company
 abc company 100 east ave ny ny 10231
ABC Company 2nd Floor
 abc company 100 east ave suite 600 ny ny 10231
BEF INC
 bef inc 500 main st boston ma 12345
BEG INC WEST
 beg inc 900 north lane san francisco ca 90121
...

有人用其他解决方案已经解决了这个问题,或者对插件有什么建议可以帮助实现这一特定结果?

Has anyone solved this problem already with other solution, or have any recommendations on plugins that would help achieve this specific result?

推荐答案

您应该明确查看选择2 (加载远程数据的特殊情况).它可以像这样生成一个下拉列表:

You should definitively took a look at Select 2 (the particular case of Loading Remote Data). It can generate a drop down like that :

而且您还可以为客户节省时间,因为您可以加载自动完成之类的元素.

And you will also save time for you customer since you can load elements like autocomplete.

这篇关于如何在HTML选择框中的选项中添加说明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆