code:
<%
sql = "select cityid,shengid,city from newcity order by cityid"
set obj = conn.execute(sql)
%> <script language = "JavaScript">
var onecouant;
onecouant=0;
subcata = new Array();
<%
count1 = 0
do while not obj.eof
%>
subcata[<%=count1%>] = new Array("<%= trim(obj("City"))%>","<%= trim(obj("shengid"))%>","<%= trim(obj("cityid"))%>");
<%
count1 = count1 + 1
obj.movenext
loop
obj.close
set obj=nothing
%>
onecouant=<%=count1%>;
function changelocation3(id)
{
document.upload.city.length = 0;
var id=id;
var i;
document.upload.city.options[0] = new Option('----------请选择城市---------','');
for (i=0;i < onecouant; i++)
{
if (subcata[i][1] == id)
{
document.upload.city.options[document.upload.city.length] = new Option(subcata[i][0], subcata[i][2]);
}
}
}
</script>
<strong>选择省份</strong:<select name="sheng" onChange="changelocation3(document.upload.sheng.options[document.upload.sheng.selectedIndex].value)" size="1">
<option value="" selected>----------请选择省份---------</option>
<%
sql1 = "select sheng,shengid from newsheng order by Shengid"
set obj1 = conn.Execute (sql1)
do while not obj1.eof
%>
<option value="<%=trim(obj1("Shengid"))%>"><%=trim(obj1("Sheng"))%></option>
<%
obj1.movenext
loop
obj1.close
set obj1 = nothing