聯動菜單

intID=Request("intID")
  if trim(intID)="" then
    Response.Write("非法連接")
    Response.End()
  end if
  '初始化庫
  set Conn=Server.CreateObject("ADODB.Connection")
  Conn.open Application("db")
  Set Rs2=Server.CreateObject("ADODB.RecordSet")
      exec="select * from wt"
  Rs2.open exec,Conn,0,1
%>
<script language="javascript">
<!--
  var twoCount 
  twoCount=0
  TwoArray=new Array()
<%
  SecondCount=0
  do while not Rs2.eof
%>
  TwoArray[<%=SecondCount%>]=new Array('<%=trim(Rs2("ID"))%>','<%=trim(Rs2("Name"))%>')
<%
  SecondCount=SecondCount+1
  Rs2.MoveNext
  Loop
  Rs2.close
  set Rs2=nothing
%>
  twoCount=<%=SecondCount%>  

賦值:

<script language="javascript">
function ChangeKind()
{ var object=document.form1.selectNewsType
  //清空下拉框
  object.length=0  
  if(S_IsNews=="0")
  {
        //把div selectTop顯示 select  爲selecttopic
    document.getElementById("selectTop").style.visibility="visible"
    document.getElementById("selectTop").style.display=""
    for(var j=0;j<oneCount;j++)
    {
      
      document.form1.selectTopic.options.add(new Option(OneArray[j][1].substring(0,20),OneArray[j][0],true,true))
    }
  }}
</script>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章