var inputs = document.admin.getElementsByTagName("input"); 这样试一下:
var inputs = document.forms["admin"].getElementsByTagName("input"); 

解决方案 »

  1.   


    <html>
    <head>
    </head><script>
       function init(){
          lock(document.getElementById('chkLock'))
          t=document.location.hash.replace('#','');
          if(t=='')t=1;
          switchTag('tag'+t,'content'+t);//这个方法不在页面上,无法进行修改
    }
        function lock(obj){ 
            //var inputs = document.admin.getElementsByTagName("input");//注释掉
            var inputs = document.getElementsByTagName("input");//换成这个
            for(var i=0; i <inputs.length; i++){ 
                if(inputs[i].type == "text" && inputs[i].name != "servername"){ 
                          inputs[i].disabled = !obj.checked; 
                } 
            } 
        } 
        window.onload = function(){
            document.getElementById("chkLock").checked = true;
            document.getElementById("chkLock").click();
        }
    </script>
    //页面的格式进行了调整。加了table,tr等
    <body onload="init()">
        <table>
            <tr>
                <td width="44%" height="24" align="right">
                    IP地址:</td>
                <td width="56%" align="left">
                    <input name="ip" type="text" id="ip" value="<?php echo $ip?>" onblur="check_ip(this.value)" /></td>
            </tr>
            <tr>
                <td width="44%" height="24" align="right">
                    子网掩码:</td>
                <td width="56%" align="left">
                    <input name="netmask" type="text" id="netmask" value="<?php echo $netmask?>" onblur="check_ip(this.value)" /></td>
            </tr>
            <tr>
                <td width="44%" height="24" align="right">
                    默认网关:</td>
                <td width="56%" align="left">
                    <input name="gateway" type="text" id="gateway" value="<?php echo $gateway?>" onblur="check_ip(this.value)" /></td>
            </tr>
            <tr>
                <td height="24" align="right">
                    服务器别名:</td>
                <td align="left">
                    <input name="servername" type="text" id="servername" value="<?php $servername = iconv('utf-8','gb2312',$servername); echo $servername;?>" /></td>
            </tr>
        </table>
        <table width="87%" height="24" border="0" align="center" cellpadding="0" cellspacing="1">
            <tr>
                <td height="25" align="center">
                    <input name="tijiao" type="submit" class="btn" border="0" value="确 定">&nbsp;
                    <input type="checkbox" value="1" id="chkLock" onclick="lock(this)" name="chkLock" /><label
                        for="chkLock">手动设置</label>
                </td>
            </tr>
        </table>
    </body>
    </html>
      

  2.   

    把上面[color=#FF0000],这个都去掉,