概述
<form name=f1 METHOD="POST">
<%
OpenDB objConn, "xxxx"
Set RSClass = objConn.Execute("select * from class Order by fldClass")
If RSClass.EOF Then
Response.Write "噢,没有记录!<BR>"
Else
Response.Write "<select NAME=""class"" style=""FONT-SIZE: 9pt"" SIZE=10"
" ONCHANGE=""classselected(this);"" >"
sjavascript = "function classselected(elem){" &_
vbCrlf
"for (var i = document.f1.sort.options.length; i >= 0; i--){"
"document.f1.sort.options[i] = null;"
vbCrlf
Do Until RSClass.EOF
If sLastClass <> RSClass("fldClass") Then
sLastClass = RSClass("fldClass")
Response.Write "<OPTION VALUE=" & RSClass("fldID") & ">" & sLastClass & "</OPTION>"
sjavascript = sjavascript & "}"
"if (elem.options[elem.selectedIndex].value=="
RSClass("fldID") & "){"
End If
sjavascript = sjavascript
"document.f1.sort.options[document."
"f1.sort.options.length] = new Option('"
RSClass("fldSort") & "','" & RSClass("fldID") & "');"
vbCrlf
RSClass.MoveNext
Loop
Response.Write "</select>"
Response.Write "<select NAME=""sort"" style=""FONT-SIZE: 9pt"" SIZE=10>"
Response.Write "<OPTION>请选择</OPTION>"
Response.Write "</select>"
sjavascript = sjavascript & "}" & "}"
Response.Write "<SCR" & "IPT LANGUAGE=""javascript"">"
Response.Write sjavascript & "</SCR" & "IPT>"
End If
RSClass.Close
Set RSClass = Nothing
%>
</form>
最后
以上就是甜蜜鞋垫为你收集整理的如何制作关联的下拉菜单?的全部内容,希望文章能够帮你解决如何制作关联的下拉菜单?所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复