Call Process
<%
Dim RSS, u
Set RSS = server. Createobject ("ADODB. recordset ")
RSS. Open "select ID, parentid, sortname from [sorts] order by parentid", Conn, 1, 1
Response. Write "<select onchange =" "mm_jumpmenu ('false', this, 0)"> "& getlisttree &" <SELECT>"
RSS. Close
%>
The function that generates the menu. Function getlisttree
Dim result, I
Redim U (RSS. recordcount, 3)
For I = 1 to RSS. recordcount
U (I-1, 0) = RSS ("ID ")
U (I-1, 1) = RSS ("parentid ")
U (I-1, 2) = RSS ("sortname ")
RSS. movenext
Next
'Rss. movefirst
For I = 0 to ubound (u)-1
If int (U (I, 1) = 0 then
Result = Result & "<option value = '? Sortid = "& U (I, 0) &" & parentid = "& parentid &" '> random "& U (I, 2) & "</option>" & vbcrlf & sunsorts (U (I, 0), 0)
End if
Next
Getlisttree = Result
End Function
Function sunsorts (WHO, sunlevel)
Dim selected
Dim result, I, SP, endid
For I = 0 to sunlevel
SP = sp &"--"
Next
For I = 0 to ubound (u)-1
If int (U (I, 1) = int (WHO) then
Endid = U (I, 0)
End if
Next
For I = 0 to ubound (u)-1
If int (U (I, 1) = int (WHO) then
If u (I, 0)-endid = 0 then
Result = Result & "<option" & selected & "value = '? Sortid = "& U (I, 0) &" & parentid = "& parentid &" '> "& sp &" random "& U (I, 2) & "</option>" & vbcrlf & sunsorts (U (I, 0), sunlevel + 1)
Else
Result = Result & "<option" & selected & "value = '? Sortid = "& U (I, 0) &" & parentid = "& parentid &" '> "& sp &" random "& U (I, 2) & "</option>" & vbcrlf & sunsorts (U (I, 0), sunlevel + 1)
End if
End if
Next
Sunsorts = Result
End Function
Effect