只要复制以下代码,运行OK.
可以对任何表单对象都起作用。<%@page language="java" contentType="text/html;charset=GBK"%>
<%
String rd="v";%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>只读例子</title>
</head><body>
<form name="form1" method="post" action="">
<input type="text" name="textfield" <%if ("y".equals(rd)) {%> readonly<%}%> >
</form>
</body>
</html>
可以对任何表单对象都起作用。<%@page language="java" contentType="text/html;charset=GBK"%>
<%
String rd="v";%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>只读例子</title>
</head><body>
<form name="form1" method="post" action="">
<input type="text" name="textfield" <%if ("y".equals(rd)) {%> readonly<%}%> >
</form>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货