网络编程 
首页 > 网络编程 > 浏览文章

如何制作关联的下拉菜单?

(编辑:jimmy 日期: 2024/11/25 浏览:3 次 )

<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);"" >"

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

s"}" 

"if (elem.options[elem.selectedIndex].value=="

RSClass("fldID") & "){"

End If

s"MARGIN: 0cm 0cm 0pt">"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>"

 

s"mso-spacerun: yes">  & "}"  & "}"

 

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

Response.Write s"mso-spacerun: yes">  & "</SCR" & "IPT>"

 

End If

RSClass.Close

Set RSClass = Nothing

%>

</form>

 

上一篇:如何测试字符串的长度?
下一篇:如何在读取Excel文件时创建列表的下拉菜单?
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 网站地图 SiteMap