若选中第m行,textbox在n列
tbl.rows[m].cells[n].children[0].disabled=true;

解决方案 »

  1.   

    <script type="text/javascript">
        //<![CDATA[
        function foo(o) {
          var e = o;
          while (o.tagName!="TR") {
            o=o.parentNode;
          }
          var a=o.getElementsByTagName("INPUT");
          for (var i=0; i<a.length; i++) {
            if (a[i].type.toLowerCase()=="text")
              a[i].disabled=e.checked;
          }
        }
        //]]>
        </script>
        <table border="0" cellpadding="0" cellspacing="0" width="100%" >
          <tr>
            <td><input type="checkbox" onclick="foo(this)"/></td>
            <td><input value="http://www.never-online.net"/></td>
          </tr>
          <tr>
            <td><input type="checkbox" onclick="foo(this)"/></td>
            <td><input/></td>
          </tr>
        </table>
      </body>
      

  2.   

    <script>
    function fn(obj){
    if(obj.checked){
      obj.parentElement.parentElement.cells[1].children[0].disabled=true;
    }
    else{
      obj.parentElement.parentElement.cells[1].children[0].disabled=false;
    }
    }
    </script>
    <table><tr><Td><input type=checkbox onclick="fn(this)"></td><td><input type=textbox ></td></tr>
    <tr><Td><input type=checkbox onclick="fn(this)"></td><td><input type=textbox ></td></tr>
    <tr><Td><input type=checkbox onclick="fn(this)"></td><td><input type=textbox ></td></tr>
    <tr><Td><input type=checkbox onclick="fn(this)"></td><td><input type=textbox ></td></tr>
    <tr><Td><input type=checkbox onclick="fn(this)"></td><td><input type=textbox ></td></tr>
    </table>
      

  3.   

    写一个函数参数是this
    然后将checkbox的check事件中调用这个函数。
    通过this应该可以得到是第几行,可以通过sobj =obj.id.substring(0,obj.id.indexOf("txt",0)得到行的标记。后面加上文本框的名。var s="document.Form1."+ sobj +"txt.disabled=false";将文本框设为不可用。eval(s);