主题:  请教:在三级联动中,如何传递值?

sundy988

职务:普通成员
等级:1
金币:0.0
发贴:2
注册:2002/9/27 17:48:29
#12002/9/27 17:49:47
如何设置当前选择的值,并将值输入数据库中?谢谢!



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
#22002/9/27 18:20:48
能具体说一下你的要求么?



sundy988

职务:普通成员
等级:1
金币:0.0
发贴:2
注册:2002/9/27 17:48:29
#32002/9/28 9:05:45
谢谢,是一个三级联动表单,我在表1中(access数据库)分别建了三个字段:system,database,databaseqian,对应aalist,sslist和ddlist。
在正常的下拉菜单中,如

我可以将菜单的值
rst("01")=request("01")输到数据库中,但在这个三级联动中,值在哪里,如何传输?谢谢!

------------------------三级联动菜单如下----------------------------


//连接数据库代码如下


<%
set Re = Server.CreateObject("ADODB.Recordset")
Re.ActiveConnection = MM_con12_STRING
Re.Source = "SELECT * FROM ok"
Re.CursorType = 0
Re.CursorLocation = 2
Re.LockType = 3
Re.Open()
Re_numRows = 0
%>
<%
CALL listmaker(aalist,"aa", sslist ,"ss", ddlist, "dd", pubevent, pubfun, "myForm")
%>

//三级联动菜单如下:
<%= aalist%>
<%= sslist%>
<%= ddlist%>

//实现联动代码如下:

<%

SUB listmaker(byref list1, system, byref list2, database, byref list3, databaseqian, byref myevent, byref myfun, myForm)
aalist="sslist=sslist & "(this.selectedIndex);"">"
ddlist=""

sslist= sslist & ""

ddlist= ddlist & ""


myevent=vbcrlf & "key=new Array(" & howmanygroups+1 & ");"
myevent=myevent & vbcrlf & "key1=new Array(" & howmanygroups+1
myevent=myevent & ");" & vbcrlf & tempSTR




tempSTR =vbcrlf & "function Buildkey" & "(num)" & vbcrlf
tempSTR =tempSTR & "{" & vbcrlf
tempSTR =tempSTR & "Buildkey1(0);" & vbcrlf
tempSTR =tempSTR & "document." & myForm & "."
tempSTR =tempSTR & database & ".selectedIndex=0;" & vbcrlf
tempSTR =tempSTR & "for(ctr=0;ctrtempSTR =tempSTR & "{" & vbcrlf
tempSTR =tempSTR & "document." & myform & "." & database
tempSTR =tempSTR & ".options[ctr]=new Option(key[num][ctr],"
tempSTR =tempSTR & "key[num][ctr]);" & vbcrlf
tempSTR =tempSTR & "}" & vbcrlf
tempSTR =tempSTR & "document." & myForm & "." & database
tempSTR =tempSTR & ".length=key[num].length;" & vbcrlf
tempSTR =tempSTR & "}" & vbcrlf

tempSTR =tempSTR & vbcrlf & "function Buildkey1" & "(num)" & vbcrlf
tempSTR =tempSTR & "{" & vbcrlf
tempSTR =tempSTR & "document." & myForm & "."
tempSTR =tempSTR & databaseqian & ".selectedIndex=0;" & vbcrlf
tempSTR =tempSTR & "for(ctr=0;ctrtempSTR =tempSTR & "{" & vbcrlf
tempSTR =tempSTR & "document." & myform & "." & databaseqian
tempSTR =tempSTR & ".options[ctr]=new Option(key1[document.myForm.aa.selectedIndex][num][ctr],"
tempSTR =tempSTR & "key1[document.myForm.aa.selectedIndex][num][ctr]);" & vbcrlf
tempSTR =tempSTR & "}" & vbcrlf
tempSTR =tempSTR & "document." & myForm & "." & databaseqian
tempSTR =tempSTR & ".length=key1[document.myForm.aa.selectedIndex][num].length;" & vbcrlf
tempSTR =tempSTR & "}" & vbcrlf
myfun=tempSTR


END sub
%>
<%
Re.Close()
%>