<%
Dim rs
Dim SQL
Dim count
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select * From kml_sclass"
Rs. Open SQL, Conn, 1, 1
%>
<Script language = "JavaScript">
VaR onecount;
Onecount = 0;
Subcat = new array ();
<%
Count = 0
Do while not Rs. EOF
%>
Subcat [<% = count %>] = new array ("<% = trim (RS (" sclassname ") %> ", "<% = trim (RS (" bclassid ") %>", "<% = trim (RS (" sclassid ") %> ");
<%
Count = count + 1
Rs. movenext
Loop
Rs. Close
%>
Onecount = <% = count %>;
Function changelocation (locationid)
{
Document. myform. sclassid. Length = 0;
VaR locationid = locationid;
VaR I;
For (I = 0; I <onecount; I ++)
{
If (subcat [I] [1] = locationid)
{
Document. myform. sclassid. Options [document. myform. sclassid. Length] = New Option (subcat [I] [0], subcat [I] [2]);
}
}
}
</SCRIPT>
</Head>
<Body>
<Br>
<Form name = "myform" method = "Post" Action = "? Action = addsave ">
<Table width = "80%" border = "0" align = "center" cellpadding = "2" cellspacing = "1" bgcolor = "# cccccc">
<Tr bgcolor = "# f6f6f6">
<TD Height = "25" colspan = "2"> <Div align = "center"> <strong> modify news </strong> </div> </TD>
</Tr> <tr bgcolor = "# f6f6f6"> <TD align = "center" Height = "25"> News style: </TD> <input name = "jibie" type = "radio" value = "0" Checked>
Chinese version </TD> </tr>
<Tr>
<TD width = "15%" Height = "25" align = "right" bgcolor = "# f6f6f6"> Article type: </TD>
& Lt; TD width = "85%" bgcolor = "# ffffff" & gt;
<%
SQL = "select * From kml_bclass"
Rs. Open SQL, Conn, 1, 1
If Rs. EOF and Rs. bof then
Response. Write "add a column first. "
Response. End
Else
%>
<Select name = "bclassid" onchange = "changelocation (document. myform. bclassid. Options [document. myform. bclassid. selectedindex]. Value)" size = "1">
<Option selected value = "<% = trim (RS (" bclassid ") %>"> <% = trim (RS ("bclassname") %> </option>
<% Dim selclass
Selclass = RS ("bclassid ")
Rs. movenext
Do while not Rs. EOF
%>
<Option value = "<% = trim (RS (" bclassid ") %>"> <% = trim (RS ("bclassname") %> </option>
<%
Rs. movenext
Loop
End if
Rs. Close
%>
</SELECT>
<Select name = "sclassid">
<%
SQL = "select * From kml_sclass where bclassid =" & selclass
Rs. Open SQL, Conn, 1, 1
If not (Rs. EOF and Rs. bof) then
%>
<Option selected value = "<% = RS (" sclassid ") %>"> <% = RS ("sclassname") %> </option>
<%
Rs. movenext
Do while not Rs. EOF
%>
<Option <% if rsedit ("sclassid") = RS ("sclassid") Then %> selected <% end if %> value = "<% = RS (" sclassid ") %> "> <% = RS (" sclassname ") %> </option>
<%
Rs. movenext
Loop
End if
Rs. Close
Set rs = nothing
%>
</SELECT>