searatt.asp
来自「投资管理系统, asp+ mssql server」· ASP 代码 · 共 80 行
ASP
80 行
<%
set rsTmp=server.createobject("ADODB.Recordset")
strSql="select daihao,Attribute from tblAttribute order by daihao"
rsTmp.open strsql,conn,1,1
if not rsTmp.eof then
ArrClass1=rsTmp.getrows
end if
rsTmp.close
strSql="select daihao,AttributeID,Attribute from tblAttribute2 order by daihao"
rsTmp.open strsql,conn,1,1
if not rsTmp.eof then
ArrClass2=rsTmp.getrows
end if
rsTmp.close
'strSql="select ID,LoginName,Name from tblUserLogin order by ID"
'rsTmp.open strsql,connqq,1,1
'if not rsTmp.eof then
' ArrClass3=rsTmp.getrows
'end if
'rsTmp.close
str1=""
for i=0 to ubound(arrClass1,2)
str1=str1&"'"&trim(arrClass1(0,i))&"."&trim(arrClass1(1,i))&"',"
next
str1=left(str1,len(str1)-1)
str2=""
for i=0 to ubound(arrClass2,2)
str2=str2&"'"&trim(arrClass2(1,i))&"."&trim(arrClass2(2,i))&"."&trim(arrClass2(0,i))&"',"
next
str2=left(str2,len(str2)-1)
'str3=""
'for i=0 to ubound(arrClass3,2)
'str3=str3&"'"&trim(arrClass3(1,i))&"."&trim(arrClass3(2,i))&"."&trim(arrClass3(0,i))&"',"
'next
'str3=left(str3,len(str3)-1)
response.write "<script language=""javascript"">"& chr(13)
response.write "{"& chr(13)
response.write "var arrJClass1=new Array("& str1 &");"& chr(13)
response.write "var arrJClass2=new Array("& str2 &");"& chr(13)
'response.write "var arrJClass3=new Array("& str3 &");"& chr(13)
response.write "function ShowClass2(AttributeID)"& chr(13)
response.write "{"& chr(13)
response.write "var len=document.searchform.Attribute2.length-1 ;"& chr(13)
response.write "var k;"& chr(13)
response.write "for(k=len;k>=0 ;--k){"& chr(13)
response.write "document.searchform.Attribute2.remove (k);}"& chr(13)
response.write "oOption=document.createElement (""OPTION"");"& chr(13)
response.write "oOption.text="""";"& chr(13)
response.write "oOption.value="""";"& chr(13)
response.write "document.forms[0].Attribute2.add (oOption);"& chr(13)
response.write "for (i = 0; i < arrJClass2.length; i++)"& chr(13)
response.write "{"& chr(13)
response.write "var position=0;"& chr(13)
response.write "var myarray=new Array('0','0','0');"& chr(13)
response.write "var m_strings = arrJClass2[i];"& chr(13)
response.write "m_strings = m_strings + '.';"& chr(13)
response.write "var j=0;"& chr(13)
response.write "while((position=m_strings.indexOf("".""))!==-1){"& chr(13)
response.write "myarray[j]=m_strings.substring(0,position);"& chr(13)
response.write "m_strings=m_strings.substring(position+1);"& chr(13)
response.write "j++;"& chr(13)
response.write "}"& chr(13) ' while
response.write "if(myarray[0]==AttributeID){"& chr(13)
response.write "oOption=document.createElement (""OPTION"");"& chr(13)
response.write "oOption.text=myarray[1];"& chr(13)
response.write "oOption.value=myarray[2];"& chr(13)
response.write "document.forms[0].Attribute2.add (oOption);"& chr(13)
response.write "}"& chr(13)'if
response.write "}"& chr(13)'for
response.write "}"& chr(13)'function
response.write "}"& chr(13)'script
response.write "</script>"
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?