20分...人穷志短啊,帮你写啦
<script language=javascript>
var arrS2_text=new Array(),arrS2_value=new Array()
var arrS3_text=new Array(),arrS3_value=new Array()
function ini()
{
for(i=0;i<document.frmList.select2.length;i++)
{
arrS2_text[i]=document.frmList.select2.options[i].text
arrS2_value[i]=document.frmList.select2.options[i].value
}
for(i=0;i<document.frmList.select3.length;i++)
{
arrS3_text[i]=document.frmList.select3.options[i].text
arrS3_value[i]=document.frmList.select3.options[i].value
}
}
ini()
function editList(ov)
{
if(ov==1) str=100
else str=200
//select2
document.frmList.select2.length=0
document.frmList.select2.add(document.createElement("option"))
document.frmList.select2.options[0].text=arrS2_text[0]
document.frmList.select2.options[0].value=arrS2_value[0]
seq=1
for(i=1;i<arrS2_value.length;i++)
{
ostr=arrS2_value[i]
ostr=ostr.substring(0,3)
if(ostr!=str) continue
document.frmList.select2.add(document.createElement("option"))
document.frmList.select2.options[seq].text=arrS2_text[i]
document.frmList.select2.options[seq].value=arrS2_value[i]
seq++
}
//select3
document.frmList.select3.length=0
document.frmList.select3.add(document.createElement("option"))
document.frmList.select3.options[0].text=arrS3_text[0]
document.frmList.select3.options[0].value=arrS3_value[0]
seq=1
for(i=1;i<arrS3_value.length;i++)
{
ostr=arrS3_value[i]
ostr=ostr.substring(0,3)
if(ostr!=str) continue
document.frmList.select3.add(document.createElement("option"))
document.frmList.select3.options[seq].text=arrS3_text[i]
document.frmList.select3.options[seq].value=arrS3_value[i]
seq++
}
}
editList(1)
</script>