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"/>

 

 

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

 

posted @ 2019-06-01 22:52  鳄鱼菌  阅读(623)  评论(0编辑  收藏  举报