Ok, there are a few things not quite right:
1. the function isChecked should get a string as the first argument, but you are passing in an object, hence x is undefined so you get an error on x.checked. You need to pass in a string by putting ' round the parameter when you pass it in.
2. This line var y=document.form1.elements[elementId+1] is not right. If you pass in the name of the clicked checkbox as a string, e.g. "checkbox3", then you end up with the statement var y=document.form1.elements["checkbox31"];, but you actually want var y=document.form1.elements["textbox3"];. You need to change your onchange call to just pass in the number, but as a string, then it will work.
Here is a working version:
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/javascript">
function isChecked(elementId,value)
{
var x=document.form1.elements["checkbox"+elementId];
var y=document.form1.elements["textbox"+elementId];
if (x.checked)
y.disabled=value;
else
y.disabled=!(value);
}
</script>
</head>
<body>
<form name="form1" action="" method="post">
<%
for iLoop=1 to 3 %>
<input type="checkbox" name="checker" id="checkbox<%=iLoop%>" onchange="isChecked('<%=iLoop%>',false)">
<input id="textbox<%=iLoop%>" name="textbox" disabled>
<%next%>
</form>
</body>
</html>
hth
Phil