列表
<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]的形式來加以區分