请问如何将画面中的text框设为只读属性? <input id=txt>document.all.txt.disabled = "true" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 sorrydocument.all.txt.readOnly = "true" <input name=txt readonly>就可以了,如果实用程序设置则写为document.form1.txt.readonly=true 把全部代码拷过来给你,嘻。试过了,没问题<HTML> <HEAD> <title>aaa</title> <script language="javascript"> function setvalue() { txt1.readOnly=true; } </script> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"> <meta name="vs_targetSchema" Content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body> <FONT face="宋体"><INPUT id="txt1" type="text" name="txt1"> <INPUT id="Button1" type="button" value="Button" name="Button1" onclick="setvalue();"></FONT> <!--#include file="const.asp"--> </body></HTML> 对象的问题 jQuery 的dialog() 求助jsp 求教jsp中<input>限制输入长度,和敏感字符过滤问题!!! 关于ExtJs 提交表单直接在本页面显示数据的问题 一个网页中有一个表格和一个表单, 格式化输出日期 请问怎么判断标签名呢? URLEncode 编码后的字符javascript 怎么解码呢 测试js的工具? 有关window.showModalDialog的问题 如何从A网站传递一个值给B网站?,内详
document.all.txt.readOnly = "true"
就可以了,如果实用程序设置则写为
document.form1.txt.readonly=true
<HTML>
<HEAD>
<title>aaa</title>
<script language="javascript">
function setvalue()
{
txt1.readOnly=true;
}
</script>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" Content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<FONT face="宋体"><INPUT id="txt1" type="text" name="txt1">
<INPUT id="Button1" type="button" value="Button" name="Button1" onclick="setvalue();"></FONT> <!--#include file="const.asp"-->
</body>
</HTML>