var a_muni=new Array();
a_muni[0]="请选择";
a_muni[1]="";
<%
temp_i=2
municount=0
dim munipart()
redim munipart(rs.recordcount-1)
'response.write"<p>before code is ok"
while not rs.eof
municount=municount+1
munipart(municount-1)=rs("市县")
' response.write("<p>munipart="&munipart(municount-1))
%>
a_muni[<%=temp_i%>]="<%=rs("市县")%>";
a_muni[<%=temp_i+1%>]="<%=rs("市县")%>";
<%
temp_i=temp_i+2
rs.movenext
wend
rs.close
%>
var village=new array()
<% for temp_i=0 to temp_i/2-1 %>
village[<%=temp_i%> =new array();
<% next %>
village[0][0]="请选择";
village[0][1]="";
<%
temp_i=1
while temp_i<=municount
%>
village[<%=temp_i%>][0]="请选择";
village[<%=temp_i%>][0]="";
<%
response.write("munipart[temp_i]"&munipart(temp_i))
sql="select 企业_id ,乡镇 from 分支机构表 where 市县='"&munipart(temp_i)&"'"
set rs=conn.execute(sql)
temp_j=2
while not rs.eof
%>
village[<%=temp_i%>][<%=temp_j%>]="<%=rs("乡镇")%>";
village[<%=temp_i%>][<%=temp_j+1%>]="<%=rs("企业_id")%>";
<%
temp_j=temp_j+2
rs.movenext
wend
temp_j=tem_j+1
wend
%>
---------------------------------------
<script language="javascript">
var aListValue = new Array(2);
aListValue["a"] = new Array("1","2");
aListValue["b"] = new Array("3");
var nCurIndex = null;
function setupList()
{
if (nCurIndex != document.frmtest.name1.selectedIndex)
{
nCurIndex = document.frmtest.name1.selectedIndex;
var sValue = document.frmtest.name1.options[nCurIndex].value;
var i;
//remove existing list
for (i=document.frmtest.name2.options.length-1; i >=0 ; i--)
document.frmtest.name2.options.remove(i);
for (i=0; i < aListValue[sValue].length;i++)
{
var opt = new Option(aListValue[sValue][i],aListValue[sValue][i]);
document.frmtest.name2.options.add(opt);
}