如何制作关联的下拉菜单?
<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>
上一篇: 告诉你一种你没听说过的好酒:舍得酒价格
下一篇: 好像哪里不对