欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

表單內(nèi)同名元素的控制

 更新時(shí)間:2006年11月22日 00:00:00   作者:  
復(fù)制代碼 代碼如下:
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<title>同名元素的控制</title> 
<script language="javascript"> 
    function setFlag(aObj) 
        { 
            if (!aObj) 
                return false; 
            if(aObj.form.box.length>1) //超過一個(gè) 
            { 
        for (i=0;i<aObj.form.box.length;i++) 
            if (aObj.form.box[i]==aObj)             
                if (aObj.form.box[i].checked) 
                    aObj.form.txt[i].value="ok"; 
                else 
                    aObj.form.txt[i].value=""; 
                    } 
                    else 
                    { 
                    aObj.form.txt.value="oks"http://如果只有一行(無重名) 
        } 
        } 
</script> 
</head> 

<body> 
<form name="form1" method="post" action=""> 
1<input name="box" type="checkbox" id="box" value=""  onClick="javascript:setFlag(this);"/><input name="txt" type="text" id="txt" /><br> 
2<input name="box" type="checkbox" id="box" value=""  onClick="javascript:setFlag(this);" /><input name="txt" type="text" id="txt" /><br> 
3<input name="box" type="checkbox" id="box" value=""  onClick="javascript:setFlag(this);" /><input name="txt" type="text" id="txt" /> 
</form> 
</body> 
</html> 

相關(guān)文章

最新評論