关于提交的问题 呵呵,,你设置了disabled就不会把数据提交到服务器可以在提交前用脚本改回来... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在xitongok.php页面把$servername抛出来看看 <script language="javascript">function init(){ lock(document.getElementById('chkLock')) t=document.location.hash.replace('#',''); if(t=='')t=1; switchTag('tag'+t,'content'+t);} function onSubmit(){ if(!document.getElementById("chkLock").checked){ document.getElementById("chkLock").click(); } return true; } function lock(obj){ var inputs = document.admin.getElementsByTagName("input"); for(var i=0; i<inputs.length; i++){ if(inputs[i].type == "text"){ inputs[i].disabled = !obj.checked; } } } window.onload = function(){ document.getElementById("chkLock").checked = true; document.getElementById("chkLock").click(); }</script><body onload="init()"><tr><FORM name="admin" method="post" action="xitongok.php"> <?php $fp= fopen("/www/imgserver/setting.cfg","r"); fscanf($fp,"[network]"); fscanf($fp,"nic=nic0"); fscanf($fp,"[nic0]"); fscanf($fp,"dhcp=%s",$dhcp); fscanf($fp,"ip=%s",$ip); fscanf($fp,"mac=00-0C-E0-F0-3C-0F"); fscanf($fp,"netmask=%s",$netmask); fscanf($fp,"gateway=%s",$gateway); fscanf($fp,"[server]"); fscanf($fp,"name=%s",$servername); fscanf($fp,"[control]"); fscanf($fp,"restart=0"); fclose($fp); ?> <?php echo $dhcp?> <td height="125" ><table width="87%" height="73" border="0" align="center" cellpadding="0" cellspacing="1"> <tr><input type="checkbox" value="1" id="chkLock" onclick="lock(this)" name="chkLock" /><label for="chkLock">手动设置</label> <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 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="确 定" onclick="onSubmit();"> </td> </tr> </table></td></FORM> 你的$servername 有值么?打出来看看 有关贪吃蛇的问题 高手请进!!!! 关于Firefox的插件开发 我想弄在页面的表格的每行行末尾加一个小按钮 谁能指点一下啊`~~~ 100分求一道JS考题的详解 JS传递方法 js簡單問題 onchange 事件的奇怪问题 javascript跟踪调试 在线等待答案:一个超链接问题,快快帮我解决啊! Java代码抓取页面显示的内容保存为图片 大家帮忙看一下啊 一样的JS脚本..放jsp页面里就可以,写在js文件里就不行..高人帮忙找找错误啊...
<script language="javascript">
function init(){
lock(document.getElementById('chkLock'))
t=document.location.hash.replace('#','');
if(t=='')t=1;
switchTag('tag'+t,'content'+t);
}
function onSubmit(){
if(!document.getElementById("chkLock").checked){
document.getElementById("chkLock").click();
}
return true;
}
function lock(obj){
var inputs = document.admin.getElementsByTagName("input");
for(var i=0; i<inputs.length; i++){
if(inputs[i].type == "text"){
inputs[i].disabled = !obj.checked;
}
}
}
window.onload = function(){
document.getElementById("chkLock").checked = true;
document.getElementById("chkLock").click();
}</script>
<body onload="init()">
<tr><FORM name="admin" method="post" action="xitongok.php">
<?php
$fp= fopen("/www/imgserver/setting.cfg","r");
fscanf($fp,"[network]");
fscanf($fp,"nic=nic0");
fscanf($fp,"[nic0]");
fscanf($fp,"dhcp=%s",$dhcp);
fscanf($fp,"ip=%s",$ip);
fscanf($fp,"mac=00-0C-E0-F0-3C-0F");
fscanf($fp,"netmask=%s",$netmask);
fscanf($fp,"gateway=%s",$gateway);
fscanf($fp,"[server]");
fscanf($fp,"name=%s",$servername);
fscanf($fp,"[control]");
fscanf($fp,"restart=0");
fclose($fp);
?>
<?php echo $dhcp?>
<td height="125" ><table width="87%" height="73" border="0" align="center" cellpadding="0" cellspacing="1">
<tr><input type="checkbox" value="1" id="chkLock" onclick="lock(this)" name="chkLock" /><label for="chkLock">手动设置</label>
<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 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="确 定" onclick="onSubmit();">
</td>
</tr>
</table></td></FORM>