Struts 2选择只读属性 [英] Struts 2 select readonly property

查看:52
本文介绍了Struts 2选择只读属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种情况需要将<s:select>的下拉值设为只读.但是,由于<s:select>仅具有disable属性,因此如何使<s:select>表现为只读.我直接将readonly放在<s:select>上,但这没用.

I have a situation where I need to make <s:select> drop down value to read only. But since the <s:select> only has disabled property, how to make <s:select> behave read only. I have directly put readonly on <s:select> but it didn't work.

推荐答案

看起来像放置HTML属性contenteditable="true"使其表现为只读.这样一来,您将无法从下拉菜单中选择值.

It looks like putting a HTML attribute contenteditable="true" makes it to behave like readonly. That a way you couldn't select the value from dropdown.

这篇关于Struts 2选择只读属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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