----------------------调用的script语言
</script>
<%sql = "select * from ypaddtwo order by date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1%>
<script language = "JavaScript">
var onecount1;
onecount1=0;
subcat1 = new Array();
<%count = 0
do while not rs.eof%>
subcat1[<%=count%>] = new Array("<%= trim(rs("addtwo"))%>","<%= trim(rs("addone_id"))%>","<%= trim(rs("addtwo_id"))%>");
<%count = count + 1
rs.movenext
loop
rs.close
set rs=nothing%>
onecount1=<%=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 < onecount1; i++)
{
if (subcat1[i][1] == addone)
{
document.addform.addtwo_id.options[document.addform.addtwo_id.length] = new Option(subcat1[i][0], subcat1[i][2]);
}
}
}
</script>
----------下拉列表
<select name="addone_id" onChange="changelocation1(document.addform.addone_id.options[document.addform.addone_id.selectedIndex].value)">
<option value="" selected>请选择省</option>
<%
sql="select * from ypaddone order by date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
while not rs.eof%>
<option value="<%=rs("addone_id")%>"><%=rs("addone")%></option>
<%rs.movenext
wend
rs.Close()
%>
</select>
<select name="addtwo_id">
<option selected value="">请选择市</option>
</select>
好的话就给顶一个
[此贴子已经被作者于2006-3-1 11:30:37编辑过]