如何制作关联的下拉菜单?
如何制作关联的下拉菜单?
发布时间:2016-12-29 来源:查字典编辑
摘要:

<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""FONT-SIZE: 9pt"" SIZE=10"

" ONCHANGE=""classselected(this);"" >"

s"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 = s"

"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""FONT-SIZE: 9pt"" SIZE=10>"

Response.Write "<OPTION>请选择</OPTION>"

Response.Write "</select>"

sjavascript = sjavascript & "}" & "}"

Response.Write "<SCR" & "IPT LANGUAGE="""

Response.Write sjavascript & "</SCR" & "IPT>"

End If

RSClass.Close

Set RSClass = Nothing

%>

</form>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新编程10000问学习
热门编程10000问学习
编程开发子分类