错误提示:缺少对象,请大虾帮忙看一下
高尚10 2003-02-14 07:40:16 <%@include file="../../conn.jsp" %>
<%@ page contentType="text/html;charset=GBK"%>
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<LINK REL="stylesheet" HREF="../../css/css.css" TYPE="text/css">
</HEAD>
<%
int tradetype=0;
int subtype=0;
int btype=0;
int num2=0;
int atype=0;
String key="";
int[] sub=new int[20];
%>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<FORM id=form1 name=form1 action=trade_info.jsp method="post">
<TABLE align=center BORDER="0" CELLSPACING="1" CELLPADDING="3" BGCOLOR="#ffffff">
<tr>
<table align=center border="0" cellspacing="1" cellpadding="3" bgcolor="#ffffff">
<tr>
<td>
<div><select name="tradetype" size="1" LANGUAGE=javascript onchange="return tradetype_onchange()">
<option value="0" >商品类型</option>
<%
String sql="select * from trade_type where father_id=0 order by id";
ResultSet rs2=DbBean.sqlExecute(sql);
int[] fatherid=new int[20];
int num=0;
while(rs2.next()){
int id=rs2.getInt("id");
String tradestr=rs2.getString("type_name");
fatherid[num]=rs2.getInt("id");
%>
<option value="<%=id%>" <%if(id==tradetype) {out.print("selected");}%> ><%=tradestr%></option>
<%
num++;
}
rs2.close();
%>
</select></div></td>
<td>
<div> <select name="subtype" size="1" LANGUAGE=javascript >
<%
if (tradetype==0) {
%>
<option value="0" >商品子类</option>
<%}
else {
%>
<option value="0" >商品子类</option>
</select></div></td>
<TD>
<select id=atype name="atype" onchange="return atype_onchange()">
<option value=0 <%if(atype==0){out.print("selected");}%>>所有选项</option>
<option value=1 <%if(atype==1){out.print("selected");}%>>商品名称</option>
<option value=2 <%if(atype==2){out.print("selected");}%>>商品品牌</option>
<option value=3 <%if(atype==3){out.print("selected");}%>>商品厂商</option>
<option value=4 <%if(atype==4){out.print("selected");}%>>商品编码</option>
</select>
</td>
<TD>
<DIV id=ss class="chok"><input type="text" id=key name=key width=80 value="<%=key%>"></DIV>
<DIV id=kk class="brand" style="display:none">
<select id=btype name="btype" LANGUAGE=javascript>
<option value=-1 <%if(btype==0){out.print("selected");}%>>商品品牌</option>
</select>
</DIV>
</TD>
<TD>
<input type="button" value="查询" id="Submit1" name="Submit1" onclick="ftsubmit()">
</TD></TR></table>
<input type="hidden" value="search" id="typedd" name="typedd">
</TABLE></FORM>
<script language=javascript>
<!--
function tradetype_onchange(){
p = form1.tradetype;
c = form1.subtype;
update_goods_class(p.options[p.options.selectedIndex].value, c);
}
function update_goods_class(CatID2, subtype ){
subtype.length=0;
//alert(CatID2);
if (CatID2==0)
{
subtype.options[0]=new Option('商品子类',0) ;
}
else {
<%
String sqlfather1="";
ResultSet rss1;
int ii=1;
for (int jj=0;jj<fatherid.length;jj++) {
%>
if (CatID2==<%=fatherid[jj]%>) {
subtype.options[0]=new Option('商品子类',0) ;
<%
num2=0;
sqlfather1="select * from trade_type where father_id="+fatherid[jj];
rss1=DbBean.sqlExecute(sqlfather1);
ii=1;
while (rss1.next()) {
sub[num2]=rss1.getInt("id");
%>
alert(<%=num2%>);
subtype.options[<%=ii%>]=new Option('<%=rss1.getString("type_name")%>',<%=rss1.getInt("id")%>);
<%
ii++;
num2++;
}
rss1.close();
%>
subtype.options[0].selected=true;
//alert(sub[nn]);
}
<%
}
%>
}
}
function atype_onchange() {
var i=form1.atype.options.selectedIndex;
form1.atype.value=form1.atype.options[i].value;
divColl=document.all.tags("DIV");
if(form1.atype.value==2){
pp=form1.subtype;
cc=form1.btype;
update_brand(pp.options[pp.options.selectedIndex].value,cc);
for(i=0;i<divColl.length;i++){
whichE1=divColl(i);
if(whichE1.className=="chok"){
whichE1.style.display= "none";
}
else{whichE1.style.display= "block"}
}
}
else{
for(i=0;i<divColl.length;i++){
whichE1=divColl(i);
if(whichE1.className=="chok"){
if(whichE1.style.display=="none"){
whichE1.style.display="block";
}
else{
whichE1.style.display="block";
}
}
else{
if(whichE1.className=="brand"){
whichE1.style.display="none";
}
}
}
}
}
function update_brand(aa,btype){
btype.length=0;
if(aa==0){
btype.options[0]=new Option('商品品牌',0);
}
else{
<%
String sqlsubbr="";
ResultSet rssubbr=null;
int iii=1;
for(int jjj=0;jjj<sub.length;jjj++){
%>
if(aa==<%=sub[jjj]%>){
btype.options[0]=new Option('商品品牌',0);
<%
sqlsubbr="select trade_brand from trade where trade_type="+sub[jjj];
rssubbr=DbBean.sqlExecute(sqlsubbr);
iii=1;
while(rssubbr.next()){
%>
btype.options[<%=iii%>]=new Option('<%=rssubbr.getString("trade_brand")%>',<%=rssubbr.getInt("trade_id")%>);
<%
iii++;
}rssubbr.close();%>
subtype.options[0].selected=true;
}
<%
}
%>
}
}
//-->
</script>