在多选择显示样式中的SELECT元素不允许多选 [英] SELECT element in the multiple selection display style without allowing multiple selection

查看:148
本文介绍了在多选择显示样式中的SELECT元素不允许多选的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个显示多重选择显示样式的元素(它 - 框代替下拉列表),但只允许您一次选择某个东西。这可能吗?

I want to have a element that displays in the multiple selection display style (it --the box instead of the drop down), but only allows you to select on thing at a time. Is that possible?

推荐答案

这将显示一个listbox样式的select元素,一次只允许选择一个项目:

This will display a listbox-style select element that allows only one selected item at a time:

<select size="3">
    <option>1</option>
    <option>2</option>
    <option>3</option>
</select>

size atttribute将控制有多少行在控件中可见。如果您想允许选择多个项目,请将多重属性添加到select元素:

The size atttribute will control how many rows that are visible in the control. If you want to allow multiple items to be selected, add the multiple attribute to the select element:

<select size="3" multiple="multiple">

这篇关于在多选择显示样式中的SELECT元素不允许多选的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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