function select1(i){
for (n=document.shjiainfo.city.options.length-1;n>0;n--)
{
document.shjiainfo.city.options[n]=null
}
for (n=document.shjiainfo.zone.options.length-1;n>0;n--)
{
document.shjiainfo.zone.options[n]=null
}
var m=1;
document.shjiainfo.city.options[0]=new Option("请选择市","");
document.shjiainfo.zone.options[0]=new Option("请选择区","");
//以上初始化菜单 以下读数据
<%
set rs1=server.createobject("adodb.recordset")
rs1.open "select * from city",conn,1,1
while not(rs1.eof or rs1.bof)
response.Write("if (i=="""& rs1("province")&""")")
response.Write("{document.shjiainfo.city.options[m]=new Option("""&rs1("city")&""","""&rs1("city")&""");")
response.Write("m=m+1;}")
rs1.movenext
wend
rs1.close
%>
document.shjiainfo.city.options[0].selected=true //第一行为默认选择
}
function select2(i){
for (n=document.shjiainfo.zone.options.length-1;n>0;n--)
{
document.shjiainfo.zone.options[n]=null
}
var m=1;
document.shjiainfo.zone.options[0]=new Option("请选择区","");
<%
rs1.open "select * from [zone]",conn,1,1
while not(rs1.eof or rs1.bof)
response.Write("if (i=="""& rs1("city")&""")")
response.Write("{document.shjiainfo.zone.options[m]=new Option("""&rs1("zone")&""","""&rs1("zone")&""");")
response.Write("m=m+1;}")
rs1.movenext
wend
rs1.close
%>
document.shjiainfo.zone.options[0].selected=true
}