在HTML中制作多行选择框只读 [英] Making a multi-line select box read-only in HTML

查看:106
本文介绍了在HTML中制作多行选择框只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让HTML多选框成为只读?我想拥有滚动功能,但我不希望允许进行选择。

Is there a way I can make an HTML multiple select box read-only? I want to have the scrolling capability, but I don't want to allow selections to be made.

推荐答案

在发布之后 - 在禁用选择的同时保持滚动功能的正确方法是禁用每个选项:

Figured it out right after I posted -- The correct way of maintaining scrolling functionality while disabling selection is to disable each option:

<select MULTIPLE name="WG_Emp_List" class="mainText" readonly="readonly">
     <cfloop query="Agent_List">
        <cfoutput><option disabled>#LAST_NAME#, #FIRST_NAME#</option></cfoutput>
     </cfloop>
</select>

这篇关于在HTML中制作多行选择框只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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