<table width='100%' border='0' cellspacing='0' id='gridEPMS_DYZGZP_YGJDX'>
<tr><th nowrap width='50'>选择</th><th nowrap>设备名称</th><th nowrap>接地线编号</th></tr><tr><td ><input type='checkbox' value='' name='EPMS_DYZGZP_YGJDXcheck'></td><td>
<input type='text' name="EPMS_DYZGZP_YGJDXSBMC" id="EPMS_DYZGZP_YGJDXSBMC" class='wid90' readonly='true' value='aa'></td><td><input type='text' name="EPMS_DYZGZP_YGJDXJDXBH" id="EPMS_DYZGZP_YGJDXJDXBH" class='wid90' maxLength='8' value=''></td></tr>
<tr><td ><input type='checkbox' value='' name='EPMS_DYZGZP_YGJDXcheck'></td>
<td>
<input type='text' name="EPMS_DYZGZP_YGJDXSBMC" id="EPMS_DYZGZP_YGJDXSBMC" class='wid90' readonly='true' value='bb'></td><td><input type='text' name="EPMS_DYZGZP_YGJDXJDXBH" id="EPMS_DYZGZP_YGJDXJDXBH" class='wid90' maxLength='8' value=''></td></tr>
</table>
for(int i =0;i<baseForm.EPMS_DYZGZP_YGJDXcheck.length;i++){
if(document.all("EPMS_DYZGZP_YGJDXSBMC")[i].value==""||document.all("EPMS_DYZGZP_YGJDXSBMC")[i].value==null){
document.getElementById("EPMS_DYZGZP_YGJDXJDXBH")[i].readOnly = true;
}else{
document.getElementById("EPMS_DYZGZP_YGJDXJDXBH")[i].readOnly = false;
}
}
虽然表中的每个<tr> 的值是一样的,但是还是可以用[i]的形式来加以区分