struts2中的文本框不可编辑
来源:互联网 发布:古装淘宝 编辑:程序博客网 时间:2024/05/22 09:39
使文本框不可编辑,只需设置readonly="true"或disabled="true"即可
二者之间的区别:
readonly:会将文本框的值提交到后台,鼠标可将光标定位于其上
disabled:不会将文本框的值提交到后台,鼠标无法将光标定位于其上
代码:
1.s:textfield对应于原生html中的input标签
(1)readonly情形
<s:textfield id="studentName" name="studentName" readonly="true"cssStyle="background-color: #CCCCCC; color: blue"/>html写法:
<input id="studentName" name="studentName" readonly="readonly"style="background-color: #CCCCCC; color: blue"/>
若不需要readonly,则写法如下:
<s:textfield id="studentName" name="studentName" readonly="false"/>html写法:
<input id="studentName" name="studentName"/>
(2)disabled情形
<s:textfield id="studentName" name="studentName" disabled="true"cssStyle="background-color: #CCCCCC; color: blue"/>html写法:
<input id="studentName" name="studentName" disabled="disabled"style="background-color: #CCCCCC; color: blue"/>若不需要disabled,则写法如下:
<s:textfield id="studentName" name="studentName" disabled="false"/>html写法:
<input id="studentName" name="studentName"/>
2.s:textarea对应于原生html中的textarea标签,写法类似
阅读全文
0 0
- struts2中的文本框不可编辑
- 使文本框不可编辑
- 文本框不可编辑
- 使文本框不可编辑
- 设置文本框不可编辑
- 文本框不可编辑
- HTML灰色不可编辑文本框
- jQuery让文本框不可编辑
- 实现文本框不可被编辑
- JS实现文本框不可编辑
- jsp 文本框不可编辑,禁止文本框的输入,JSP页面中的文本框只显示内容,而用户无法修改
- jsp 文本框不可编辑,禁止文本框的输入,JSP页面中的文本框只显示内容,而用户无法修改
- 让文本框设为不可编辑状态
- 使文本框不可编辑的方法
- 使文本框不可编辑的方法
- struts2 中的 checkboxlist 使用,value="" 的值是一个数组,disabled 设置不可编辑
- struts2+easyui datagrid不可编辑列表显示
- 文本框限制字符长度+文本框限制只能填数字+文本框只读 不可编辑
- tomcat如何配置环境变量
- 重建二叉树06
- 关于leetcode Minimum Window Substring的思考
- Nginx作为反向代理
- numpy-线性代数
- struts2中的文本框不可编辑
- RS232和RS485、TTL有什么区别?
- CCF软件能力认证考试模拟题 ISBN号码
- 黑板客 -- 爬虫闯关 -- 关卡02
- PHP json_decode 精度丢失问题!
- Python列表的使用
- mongodb学习(三):springboot集成mongodb例子
- HDU1004 水题数气球
- 笔记--报错信息