你的问题没看太清楚,简单写了一下,不知道是不是你想要得。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function a(ctl,i)
{
if (ctl.checked)
{
document.all("1")[i].disabled = false;
}
else
{
document.all("1")[i].disabled = true;
}
}
//-->
</SCRIPT>
</head><body>
<table width="100%" border="0">
<tr>
<td width="54%"><input type="text" name="textfield" id="1" disabled></td>
<td width="46%"><input type="checkbox" name="checkbox" value="checkbox" id="2" onclick="a(this,0)"></td>
</tr>
<tr>
<td width="54%"><input type="text" name="textfield" id="1" disabled></td>
<td width="46%"><input type="checkbox" name="checkbox" value="checkbox" id="2" onclick="a(this,1)"></td>
</tr>
<tr>
<td width="54%"><input type="text" name="textfield" id="1" disabled></td>
<td width="46%"><input type="checkbox" name="checkbox" value="checkbox" id="2" onclick="a(this,2)"></td>
</tr>
<tr>
<td width="54%"><input type="text" name="textfield" id="1" disabled></td>
<td width="46%"><input type="checkbox" name="checkbox" value="checkbox" id="2" onclick="a(this,3)"></td>
</tr>
</table>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function a(ctl,i)
{
if (ctl.checked)
{
document.all("1")[i].disabled = false;
}
else
{
document.all("1")[i].disabled = true;
}
}
//-->
</SCRIPT>
</head><body>
<table width="100%" border="0">
<tr>
<td width="54%"><input type="text" name="textfield" id="1" disabled></td>
<td width="46%"><input type="checkbox" name="checkbox" value="checkbox" id="2" onclick="a(this,0)"></td>
</tr>
<tr>
<td width="54%"><input type="text" name="textfield" id="1" disabled></td>
<td width="46%"><input type="checkbox" name="checkbox" value="checkbox" id="2" onclick="a(this,1)"></td>
</tr>
<tr>
<td width="54%"><input type="text" name="textfield" id="1" disabled></td>
<td width="46%"><input type="checkbox" name="checkbox" value="checkbox" id="2" onclick="a(this,2)"></td>
</tr>
<tr>
<td width="54%"><input type="text" name="textfield" id="1" disabled></td>
<td width="46%"><input type="checkbox" name="checkbox" value="checkbox" id="2" onclick="a(this,3)"></td>
</tr>
</table>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ÎÞ±êÌâÎĵµ</title>
</head><body>
<table width="100%" border="0">
<tr>
<td width="54%"><input type="text" name="textfield" id="1"></td>
<td width="46%"><input type="checkbox" name="checkbox" value="0" id="2" onclick="c(this)"></td>
</tr>
<tr>
<td width="54%"><input type="text" name="textfield" id="1"></td>
<td width="46%"><input type="checkbox" name="checkbox" value="1" id="2" onclick="c(this)"></td>
</tr>
<tr>
<td width="54%"><input type="text" name="textfield" id="1"></td>
<td width="46%"><input type="checkbox" name="checkbox" value="2" id="2" onclick="c(this)"></td>
</tr>
<tr>
<td width="54%"><input type="text" name="textfield" id="1"></td>
<td width="46%"><input type="checkbox" name="checkbox" value="3" id="2" onclick="c(this)"></td>
</tr>
</table>
</body>
</html>
<script>
function c( input )
{
var tElement = document.getElementsByName("textfield")[parseInt(input.value,10)];
( tElement.disabled ? tElement.disabled = false : tElement.disabled = true )
}
</script>