这样写:<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type=text/css title="">
<--
body{font-size: 9pt;}
td{font-size: 9pt}
font{font-size:9pt}
input{font-size: 12; border-style: solid; border-width: 1; padding: 0;}
select{font-size: 9pt}
button{font-size: 12; border-style: solid;border-width: 1; padding: 0;}
a:link{ color: #FFFFFF; text-decoration: none}
a:visited{ color: #FFFFFF; text-decoration: none}
a:hover{ color: #FFFFFF; text-decoration: underline}
-->
</style></head>
<body bgcolor="#FFFFFF" text="#000000"><table width="600" border="2" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td bgcolor="#999999"> 
      <table width="100%" border="0" cellspacing="2" cellpadding="2">
        <tr> 
          <td><font color="#FFFFFF">E2ROM信息</font></td>
          <td>
            <div align="right"><font color="#FFFFFF"><a href="/help">帮助</a></font></div>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC">
<form name="setform" id="ook" method="post" action="cgi-bin">
        <table width="70%" border="0" align="center" cellpadding="9" cellspacing="9">
          <tr> 
            <td width="25%">
              <table width="100%" border="1" cellspacing="1" cellpadding="2">
                <tr> 
                  <td>电口1、2状态</td>
                </tr>
                <tr> 
                  <td>
                    <table width="100%" height="66" border="1" cellpadding="1" cellspacing="1">
                      <tr> 
                        <td width="44%">DUP</td>
                        <td width="56%">SPD</td>
                      </tr>
                      <tr> 
                        <td>
<span id="tb">
                          <table width="100%" border="0" cellspacing="1" cellpadding="7" >
                            <tr> 
                              <td> 
                                <input type="radio" name="r1" value="0" checked>
                                FULL</td>
                            </tr>
                            <tr> 
                              <td>
                                <input type="radio" name="r1" value="1">
                                HALF</td>
                            </tr>
                          </table>
  </span>
                        </td>
                        <td>
                          <table width="100%" border="0" cellspacing="1" cellpadding="3">
                            <tr> 
                              <td>
                                <input type="radio" name="r2" value="0" onclick="chk(1)">
                                AUTO</td>
                            </tr>
                            <tr> 
                              <td> 
                                <input type="radio" name="r2" value="1" checked onclick="chk(0)">
                                100M</td>
                            </tr>
                            <tr> 
                              <td>
                                <input type="radio" name="r2" value="2" onclick="chk(0)">
                                10M</td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
            <td width="25%">
              <table width="100%" border="1" cellspacing="1" cellpadding="2">
                <tr> 
                  <td>光口1、2状态</td>
                </tr>
                <tr> 
                  <td>
                    <table width="100%" height="66" border="1" cellpadding="1" cellspacing="1">
                      <tr> 
                        <td width="50%">DUP</td>
                        <td width="50%">SPD</td>
                      </tr>
                      <tr> 
                        <td>
                          <table width="100%" border="0" cellspacing="1" cellpadding="7">
                            <tr> 
                              <td> 
                                <input type="radio" checked>
                                FULL</td>
                            </tr>
                            <tr> 
                              <td>
                                <input type="radio">
                                HALF</td>
                            </tr>
                          </table>
                        </td>
                        <td>
                          <table width="100%" border="0" cellspacing="1" cellpadding="3">
                            <tr> 
                              <td>
                                <input type="radio">
                                AUTO</td>
                            </tr>
                            <tr> 
                              <td> 
                                <input type="radio" checked>
                                100M</td>
                            </tr>
                            <tr> 
                              <td>
                                <input type="radio">
                                10M</td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr> 
            <td colspan="2" align="right"> 
              <input type="submit" name="Submit2" value="更 改" >
              <input type="reset" name="Reset" value="取  消" onClick="chk2()">
            </td>
          </tr>
        </table>
      </form>
<script language="javascript">
function chk(torf){
  tb.disabled = torf;
}
function chk2(){
  tb.disabled = false;
}function me(){
   alert(String(document.setform.tb.defaultChecked.value));
  // document.setform.reset;
}
</script>
    
    </td>
  </tr>
</table>
</body>
</html>

解决方案 »

  1.   

    css中加上:
    #tb input{jnkc:expression(this.disabled=document.setform.r2[0].checked)}
    去掉JS中触发的程序。全部代码:<html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type=text/css title="">
    <--
    body{font-size: 9pt;}
    td{font-size: 9pt}
    font{font-size:9pt}
    input{font-size: 12; border-style: solid; border-width: 1; padding: 0;}
    select{font-size: 9pt}
    button{font-size: 12; border-style: solid;border-width: 1; padding: 0;}
    a:link{ color: #FFFFFF; text-decoration: none}
    a:visited{ color: #FFFFFF; text-decoration: none}
    a:hover{ color: #FFFFFF; text-decoration: underline}
    #tb input{jnkc:expression(this.disabled=document.setform.r2[0].checked)}
    -->
    </style></head>
    <body bgcolor="#FFFFFF" text="#000000"><table width="600" border="2" cellspacing="0" cellpadding="0" align="center">
      <tr> 
        <td bgcolor="#999999"> 
          <table width="100%" border="0" cellspacing="2" cellpadding="2">
            <tr> 
              <td><font color="#FFFFFF">E2ROM信息</font></td>
              <td>
                <div align="right"><font color="#FFFFFF"><a href="/help">帮助</a></font></div>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td bgcolor="#CCCCCC">
    <form name="setform" id="ook" method="post" action="cgi-bin">
            <table width="70%" border="0" align="center" cellpadding="9" cellspacing="9">
              <tr> 
                <td width="25%">
                  <table width="100%" border="1" cellspacing="1" cellpadding="2">
                    <tr> 
                      <td>电口1、2状态</td>
                    </tr>
                    <tr> 
                      <td>
                        <table width="100%" height="66" border="1" cellpadding="1" cellspacing="1">
                          <tr> 
                            <td width="44%">DUP</td>
                            <td width="56%">SPD</td>
                          </tr>
                          <tr> 
                            <td>
    <span id="tb">
                              <table width="100%" border="0" cellspacing="1" cellpadding="7" >
                                <tr> 
                                  <td> 
                                    <input type="radio" name="r1" value="0" checked>
                                    FULL</td>
                                </tr>
                                <tr> 
                                  <td>
                                    <input type="radio" name="r1" value="1">
                                    HALF</td>
                                </tr>
                              </table>
      </span>
                            </td>
                            <td>
                              <table width="100%" border="0" cellspacing="1" cellpadding="3">
                                <tr> 
                                  <td>
                                    <input type="radio" name="r2" value="0">
                                    AUTO</td>
                                </tr>
                                <tr> 
                                  <td> 
                                    <input type="radio" name="r2" value="1" checked>
                                    100M</td>
                                </tr>
                                <tr> 
                                  <td>
                                    <input type="radio" name="r2" value="2">
                                    10M</td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
                <td width="25%">
                  <table width="100%" border="1" cellspacing="1" cellpadding="2">
                    <tr> 
                      <td>光口1、2状态</td>
                    </tr>
                    <tr> 
                      <td>
                        <table width="100%" height="66" border="1" cellpadding="1" cellspacing="1">
                          <tr> 
                            <td width="50%">DUP</td>
                            <td width="50%">SPD</td>
                          </tr>
                          <tr> 
                            <td>
                              <table width="100%" border="0" cellspacing="1" cellpadding="7">
                                <tr> 
                                  <td> 
                                    <input type="radio" checked>
                                    FULL</td>
                                </tr>
                                <tr> 
                                  <td>
                                    <input type="radio">
                                    HALF</td>
                                </tr>
                              </table>
                            </td>
                            <td>
                              <table width="100%" border="0" cellspacing="1" cellpadding="3">
                                <tr> 
                                  <td>
                                    <input type="radio">
                                    AUTO</td>
                                </tr>
                                <tr> 
                                  <td> 
                                    <input type="radio" checked>
                                    100M</td>
                                </tr>
                                <tr> 
                                  <td>
                                    <input type="radio">
                                    10M</td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td colspan="2" align="right"> 
                  <input type="submit" name="Submit2" value="更 改" >
                  <input type="reset" name="Reset" value="取  消">
                </td>
              </tr>
            </table>
          </form>
    <script language="javascript">
    function me(){
       alert(String(document.setform.tb.defaultChecked.value));
      // document.setform.reset;
    }
    </script>
        
        </td>
      </tr>
    </table>
    </body>
    </html>