<Html>
<Head>
<Title> Add background products </title>
<Meta http-equiv = "Content-Type" content = "text/HTML; charset = gb2312">
<Link href = "../INC/Style. Css" rel = "stylesheet" type = "text/css"> <script language = "JavaScript">
Var onecount;
Onecount = 0;
Subcat = new Array ();
<%
Int count = 0;
Rs = Conn.exe cuteQuery ("select * from ego_smallsort order by Sid"); // read data
While (rs. next ())
{
String sname = new String (rs. getString ("Sname"). getBytes ("GBK"), "ISO8859_1"); // convert the character type
%>
Subcat [<% = count %>] = new Array ("<% = sname %>", "<% = rs. getInt ("Bid") %> "," <% = rs. getInt ("Sid") %> "); // generates an array
<%
Count = count + 1;
}
%>
Onecount = <% = count %>; function changelocation (id)
{
Document. form1.smallsortselect. length = 0; var id = id;
Var I;
Document. form1.smallsortselect. options [0] = new Option (select Level 2 Category ,);
For (I = 0; I <onecount; I ++)
{
If (subcat [I] [1] = id)
{
Document. form1.smallsortselect. options [document. form1.smallsortselect. length] = new Option (subcat [I] [0], subcat [I] [2]);
}
}
}
</Script>
</Head>
<Body bgcolor = "# FFFFFF"> <form name = "form1" method = "post" action = "">
<Table width = "500" border = "0" cellspacing = "0" cellpadding = "0" align = "center">
<Tr>
<Td width = "180" height = "20" align = "right"> select a level-1 category: </td>
& Lt; td width = "320" & gt;
<Select name = "bigsortselect" onChange = "changelocation (document. form1.bigsortselect. options [document. form1.bigsortselect. selectedIndex]. value)" size = "1">
<Option value = "2"> select a level-1 Category </option>
<%
Rs = Conn.exe cuteQuery ("select * from ego_bigsort order by Bid ");
While (rs. next ())
{
String Bname = new String (rs. getString ("Bname"). getBytes ("GBK"), "ISO8859_1 ");
System. out. println (Bname );
%>
<Option value = "<% = rs. getInt (" Bid ") %>"> <% = Bname %> </option>
<%
}
%>
</Select> <br>
</Td>
</Tr>
<Br>
<Tr>
<Td height = "20" align = "right"> select Level 2: </td>
<Td>
<Select name = "smallsortselect">
<Option value = "" selected> Select secondary category </option>