有关easyflow加一个二级菜单的做法:
加一个select 然后选一个默认, "资料设定"中加一个数据库, 并写一个要得到sql语句, 下面"存取资料字段" 中的"储存""显示"都选一,更新就可以了!
sql语句:
一级下拉列表是:
select * from zhsqbd
从而得到一级列表的, 生成的代码为:
<select class=T1 id='select1' name='select1' style='Position:absolute; top: 367px; left: 154px; width: 160px; height: 20px '
></select>
<Script Language=VBScript>
<!--
call GetOptionLists_select1
Sub GetOptionLists_select1()
dim strSQL, rstOption, intrstCount
strURL = "<%=Session("HttpRoot")%>"
strSQL = "select * from zhsqbd"
set objADC_Show = CreateObject("RDS.Dataspace")
set objDB_Show = objADC_Show.CreateObject("EF2KPublic.Database", strURL)
set rst = objDB_Show.CreateRecordset(strSQL, "<%=Session("strProcID")%>")
intrstCount= rst.RecordCount
if (intrstCount > 0) then
dim objOption
rst.Movefirst
for i=1 to intrstCount
strValue = rst("zhsqbd001").value & ""
strText = rst("zhsqbd001").value & ""
call CreateOption(strValue, strText, document.all("select1"))
rst.MoveNext
Next
end if
end Sub
-->
</Script>
这以上是可以得到一个从数据库里得到列表的!
问题接踵而至, 那第二个列表框怎么做相应的改变, 呵呵, 用了好长时间才解决了:
在设计流程中 "在编/检视程序代---网页对话"
中加入如下代:(这其中还有一个小波折, 那就是不管你的一级菜单怎么, 二级菜单都会不断的加,而不会删!) 只好加入了中间一:
document.getElementById("subclass").innerHTML="<select class=T1 id='select2' name='select2' style='Position:absolute; top:
369px; left: 333px; width: 116px; height: 20px ' ><option value ='select2'>选择帐号</option></select>"
但这个段程序中加入了一个ID即subclass, 这个id 是在设计页面中的一个id!
所在在页面中也要加入一,如下:
<div id="subclass" style="float:left">
<select class=T1 id='select2' name='select2' style='Position:absolute; top: 369px; left: 333px; width: 116px; height: 20px '
></select>
</div>
下面是正式的:
Sub select1_onchange()
dim strSQL, rstOption, intrstCount
strURL = "<%=Session("HttpRoot")%>"
strSQL = "select * from zhsqbd where zhsqbd001='"&document.all("select1").value&"'"
set objADC_Show = CreateObject("RDS.Dataspace")
set objDB_Show = objADC_Show.CreateObject("EF2KPublic.Database", strURL)
set rst = objDB_Show.CreateRecordset(strSQL, "<%=Session("strProcID")%>")
intrstCount= rst.RecordCount
document.getElementById("subclass").innerHTML="<select class=T1 id='select2' name='select2' style='Position:absolute; top:
369px; left: 333px; width: 116px; height: 20px ' ><option value ='select2'>选择帐号</option></select>"
if (intrstCount > 0) then
dim objOption
rst.Movefirst
for i=1 to intrstCount
strValue = rst("account").value & ""
strText = rst("account").value & ""
call CreateOption(strValue, strText, document.all("select2"))
rst.MoveNext
Next
end if
End Sub
就可以了!
呵呵! 一个问题解决之后另一个问题就出来, 在用户提交这个表单以, 在审批中第二个下拉列表不能得到用户填写的! 那怎么解决
下面就是解决办法:
二级下拉列表:
select * from zhsqbd where zhsqbd001='"&document.all("select1").value&"'
这二级下拉列, 可真是让俺费了不少劲儿才做出来的! 因为刚开始不知道这样, 从第一个列表中得到的(document.all("select1").value)也可以直接调, 这下子可解决大问题了!
真不容易, 但很快乐
📱 扫码关注公众号
扫描二维码关注我们,获取更多精彩内容
实时更新 · 干货满满