<! -- Open two tables -->
<%
Set RS1 = server. Createobject ("ADODB. recordset ")
Sql1 = "select * From type1"
Rs1.open sql1, Conn, 1, 3
Set rs2 = server. Createobject ("ADODB. recordset ")
Sql2 = "select * From type2"
Rs2.open sql2, Conn, 1, 3
%>
<Form name = "form1">
<! -- Create menu 1 -->
<Select name = "type" size = "1" onchange = "Redirect (this. Options. Value)">
<Option value = 0> select ...... </Option>
<% While not rs1.eof %>
<Option value = "<% = RS1 (" news_type_1_id ") %>"> <% = RS1 ("news_type_1_type") %> </option>
<% Rs1.movenext
Wend %>
</SELECT>
<! -- Create menu 2 -->
<Select name = "type2" size = "1">
<Option value = 0> select </option>
</SELECT>
</Div>
</Form>
<! -- The following is a specific script statement -->
<SCRIPT>
<! --
VaR temp = Document. form1.type2
Function redirect (x ){
VaR I
I = 0
For (var m = temp. Options. Length-1; m> 0; m --)
Temp. Options [m] = NULL
<% While not rs2.eof
%>
CNT = <% = rs2 ("news_type_1_id") %>
If (CNT = x ){
Temp. Options = New Option ("<% = rs2 (" news_type_2_type ") %>", "<% = rs2 (" news_type_2_id ") %> ")
I = I + 1}
<%
Rs2.movenext
Wend %>
}
// -->
</SCRIPT>