Check boxes are not usually arrays in javascript.
Try removing the attr[0] and the rate[0] in your code to look like so:
<tr>
<td >
<input type=checkbox name="attr" value="Service1" onClick="javascript:Disab(this)"> Service 1</td>
<td width=12% align=center><input type="radio" name="rate" value=1 disabled="true"></td>
<td width=12% align=center><input type="radio" name="rate" value=2 disabled="true"></td>
<td width=12% align=center><input type="radio" name="rate" value=3 disabled="true"></td>
<td width=12% align=center><input type="radio" name="rate" value=4 disabled="true"></td>
<td width=12% align=center><input type="radio" name="rate" value=5 disabled="true"></td>
</tr>
In your javascript look for these in this manner:
function Disab(obj1){
// obj1 is the argument. It matches the "this" in your onClick=".." call
// you are sending to the function. the checkbox attr[0]
// it should refer to attr[0] as you had it.
if(obj1.checked){
// if the above (obj.checked) doesn't work
// change it to (document.attr.checked)
document.forms[0].rate[0].disabled=false;
document.forms[0].rate[1].disabled=false;
document.forms[0].rate[2].disabled=false;
document.forms[0].rate[3].disabled=false;
document.forms[0].rate[4].disabled=false;
document.forms[0].rate[0].checked=false;
document.forms[0].rate[1].checked=false;
document.forms[0].rate[2].checked=false;
document.forms[0].rate[3].checked=false;
document.forms[0].rate[4].checked=false;
}
else
{
document.forms[0].rate[0].disabled=true;
document.forms[0].rate[1].disabled=true;
document.forms[0].rate[2].disabled=true;
document.forms[0].rate[3].disabled=true;
document.forms[0].rate[4].disabled=true;
document.forms[0].rate[0].checked=false;
document.forms[0].rate[1].checked=false;
document.forms[0].rate[2].checked=false;
document.forms[0].rate[3].checked=false;
document.forms[0].rate[4].checked=false;
}
}
In Javascript:
A document can have multiple forms.
A form can have multiple elements.
Elements can have multiples entries as in radio buttons and select boxes.
You can access these using indexes, sort of like what you were trying.:
document.forms[index].elements[index][index]
// where each [index] could be a different number
This gets confusing. I like naming my form and using element names
document.forms("formName").elements("elementName")[index]
Even better, as javascript know what's going on in the document:
documtent.formName.myRadioButton[2].checked
Hope this helps