<!--#include file="conn.asp"-->
<body onLoad="init()">
<form name="formxl" action="?type=add" method="post">
<%
dim rs1,rs2,rs3,count1,count2,count3
set rs1=server.CreateObject("Adodb.recordSet")
sql="select * from ca_cd"
rs1.open sql,conn,1,1
%>
<script language="javascript">
var Pcount=0;
var subCat1 = new Array();
<%
count1=0
do while not rs1.eof
%>
subCat1[<%=count1%>]=new Array("<%=rs1("cd_id")%>","<%=rs1("cd_name")%>");
<%
rs1.movenext
count1=count1+1
loop
rs1.close
set rs1=nothing
%>
Pcount=<%=count1%>
function init(){
var i;
var j;
document.formxl.xl_chandi.length=0;
document.formxl.xl_chandi.options[0]=new Option("==所选择的产地==","");
for(i=0;i<Pcount;i++){
document.formxl.xl_chandi.options[document.formxl.xl_chandi.length]=
new Option(subCat1[i][1],subCat1[i][0]);
}}
</script>
<%
set rs2=server.CreateObject("Adodb.recordSet")
sql="select * from ca_pp"
rs2.open sql,conn,1,1
%>
<script language="javascript">
var Ccount=0;
var subCat2=new Array();
<%
count2=0
do while not rs2.eof
%>
subCat2[<%=count2%>]=new Array("<%=rs2("pp_name")%>","<%=rs2("pp_name")%>","<%=rs2("pp_chandi")%>");
<%
count2=count2+1
rs2.movenext
loop
rs2.close
set rs2=nothing
%>
Ccount=<%=count2%>
function changedCity(cityId){
var i;
document.formxl.xl_pinpai.length=0;
document.formxl.xl_pinpai.options[0]=new Option("==所选择的品牌==","");
for(i=0;i<Ccount;i++){
if(subCat2[i][2]==cityId){
document.formxl.xl_pinpai.options[document.formxl.xl_pinpai.length]=
new Option(subCat2[i][1],subCat2[i][0]);
}}}
</script>
<select name="xl_chandi" id="xl_chandi" onChange="changedCity(document.formxl.xl_chandi.options[document.formxl.xl_chandi.selectedIndex].value)" style="WIDTH: 130px" >
<option value="">==请选择的产地==</option>
</select>
<select name="xl_pinpai" id="xl_pinpai" onChange="changedBorough(document.formxl.xl_pinpai.options[document.formxl.xl_pinpai.selectedIndex].value)" style="WIDTH: 130px">
<option value="">==请选择的品牌==</option>
</select>
<input name="xl_name" value="" size="30">
<input name="submit" type="submit" value="添加">
</form>





