html和jsp页面中把文本框禁用,只能读不能写的方法

方法常用有三种:

第一种,使用   onfocus="this.blur()"

1 <input name="deptno" type="text" class="dfinput" value="${requestScope.dept.deptno}"  onfocus="this.blur()"/>

第二种,使用   disabled=“disabled”

1 <input name="deptno" type="text" class="dfinput" value="${requestScope.dept.deptno}"  disabled="disabled"/>

第三种,使用  readonly=“true

1 <input name="deptno" type="text" class="dfinput" value="${requestScope.dept.deptno}"  readonly="true"/>

水平有限,如果还有其它的方式,请评论留言。

内容
原文地址:https://www.cnblogs.com/eyjdbk/p/10961353.html