第一个select的onchange事件触发form_onsubmit事件,然后用第一个select中的选定值作为条件筛选结果显示在第二个select中还有就是都查出来,然后通过createElement("OPTION")的方式进行处理。
给你一个例子(VBScript)
set newitems = document.createElement("OPTION")
AddCustomer.SelectedProducts.options.add(newitems)
newitems.innertext=trim(AddCustomer.ExistProducts.options(ls).text)
newitems.value=trim(AddCustomer.ExistProducts.options(ls).value)
AddCustomer.ExistProducts.options.remove(ls)
给你一个例子(VBScript)
set newitems = document.createElement("OPTION")
AddCustomer.SelectedProducts.options.add(newitems)
newitems.innertext=trim(AddCustomer.ExistProducts.options(ls).text)
newitems.value=trim(AddCustomer.ExistProducts.options(ls).value)
AddCustomer.ExistProducts.options.remove(ls)
-----------------
删除下拉框select的一个选项,
select.options[i]=null
构造select一个选项
select.options[i]=new Option("label","value");
指定Options的数量
selectObj.options.length = n
-----------------
至于赋给javascript数组给你个参考
<%
Rs.open str,conn,1,1
arr=Rs.GetRows()
Rs.Close()
conn.close()
set Rs=nothing
%>
<script language=javascript>
var resultarray = new Array(3) //字段数
for(var i=0;i<3;i++)
resultarray[i]=new Array()
<%
dim intCount
intCount=0
for intCount to ubound(arr,2)
%>
resultarray[0][<%=intCount%>]=<%=arr(0,intCount)%>;
resultarray[1][<%=intCount%>]=<%=arr(1,intCount)%>;
resultarray[2][<%=intCount%>]=<%=arr(2,intCount)%>;
<% next %>
</script>
if con_id = "" or con_id = empty then
con_id=rs("id")
end if
for i = 1 to rs.recordcount
if con_id=rs("id") then
response.write "<option value=" & rs("id") & " selected>" & rs("id") & "</option>"
'con_id=rs("id")
else
response.write "<option value=" & rs("id") & ">" & rs("id") & "</option>"
end if
rs.movenext
next
response.write "</select>"
sql="select * from tse03_contract where id='"&con_id& "'"
rs.open sql,conn,3,3
if rs.recordcount> 0 then
response.write "<select name=wwww style='width;130px'>"
for i = 1 to rs.recordcount
response.write " <option>" & rs("") & "</option>"
rs.movenext
next
response.write"</select>"
<!--
var myVec = {
"01,01,01" : "aaaa",
"01,01,02" : "bbbb",
"01,02,01" : "cccc"
};alert(myVec["01,01,01"])
alert(myVec["01,02,01"])
//--></script>