在这个table后面执行这样的javascriptdocument.all.输入框ID.disabled = true;所有输入框都要加------------------------------------------------
www.cndigs.com掘客园--发掘、推荐软件开发资源,分享、交流技术开发心得
asp.net2.0资料
http://www.cndigs.com/search.php?search=asp.net%202.0&tag=true
asp.net资料
http://www.cndigs.com/search.php?search=asp.net&tag=true
ajax资料
http://www.cndigs.com/search.php?search=ajax&tag=true
www.cndigs.com掘客园--发掘、推荐软件开发资源,分享、交流技术开发心得
asp.net2.0资料
http://www.cndigs.com/search.php?search=asp.net%202.0&tag=true
asp.net资料
http://www.cndigs.com/search.php?search=asp.net&tag=true
ajax资料
http://www.cndigs.com/search.php?search=ajax&tag=true
<head>
</head>
<script language="javascript">
function readonlySwitch(){
var textBoxes = document.getElementById("t").getElementsByTagName("input");
for(var i=0;i<textBoxes.length;i++){
if(textBoxes[i].type=="text"){
if(textBoxes[i].readOnly!=true){
textBoxes[i].readOnly=true;
}else{
textBoxes[i].readOnly=false;
}
}
}
}
</script>
<body>
<table id="t" cellpadding=0 cellspacing=0 border=1 style="border-collapse:collapse;">
<tr><td><input type="text"/></td></tr>
<tr><td><input type="text"/></td></tr>
<tr><td><input type="text"/></td></tr>
<tr><td><input type="text"/></td></tr>
<tr><td><input type="text"/></td></tr>
<tr><td><input type="text"/></td></tr>
<tr><td><input type="checkbox" onclick="readonlySwitch()"/></td></tr>
</table>
</body>
</html>单击复选框就能切换