87,923
社区成员
发帖
与我相关
我的任务
分享
<html>
<BODY>
<form name= "branchForm" method= "post">
<select name= "branchLevel" property= "ilevel" onChange= "selectdu()" size= "1" style= "width: 210px; height: 20 " >
<option value= " "/>
<option value=17> 国家 </option>
<option value=18> 省(州) </option>
<option value=19> 地、市、厅 </option>
<option value=20> 院(处) </option>
</select>
<select name= "nation" style= "width:210px; height:20 "> </select>
<select name= "province" style= "width:210px; height:20 "> </select>
<select name= "organizaiton" style= "width:210px; height:20 "></select>
</form>
<script language= "JavaScript">
function selectdu()
{
var obj= document.branchForm;
var strSel = obj.branchLevel.options[document.branchForm.branchLevel.selectedIndex].text;
alert(strSel);
if(strSel=="国家")
{
obj.nation.disabled = false;
obj.province.disabled = true;
obj.organizaiton.disabled = true;
}
else if(strSel == "省(州)")
{
obj.nation.disabled = true;
obj.province.disabled = false;
obj.organizaiton.disabled =true;
}
else if(strSel=="地、市、厅")
{
obj.nation.disabled = true;
obj.province.disabled = true;
obj.organizaiton.disabled = false;
}
else
{
obj.nation.disabled =false;
obj.province.disabled =false;
obj.organizaiton.disabled=false;
}
}
</script>
</BODY>
</html>