<%sql = "select * from SMT_ypaddtwo order by SMT_date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%count = 0
do while not rs.eof%>
subcat[<%=count%>] = new Array("<%= trim(rs("SMT_addtwo"))%>","<%= trim(rs("SMT_addone_id"))%>","<%= trim(rs("SMT_addtwo_id"))%>");
<%count = count + 1
rs.movenext
loop
rs.close
set rs=nothing%>
onecount=<%=count%>;
function changelocation1(addone)
{
document.addform.addtwo_id.length = 0;
var addone_id=addone_id;
var i;
document.addform.addtwo_id.options[0] = new Option('请选择市','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == addone)
{
document.addform.addtwo_id.options[document.addform.addtwo_id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
联动下拉框使用以上函数实现,修改时从库里选择后selected选项失效,为什么?