javascript|vbscript| Display | string
ASP VBScript + Javascript in string two cascading display folder action: Lists the subfolders in the current settings directory, lists the subfolders in the subfolder, and dynamically displays the subfolders that are subordinate to them when you change a subfolder of the first level. Note: Javascript is a string method to determine the cascading object, which is the first-level subfolder name. and displays the contents of the Level two list box when the page is loaded with a target association selected by the first-level subfolder. Shawl.qiu 2006-7-28
ASP VBScript + Javascript display folder in string two cascade
Role: Lists the subfolders in the current settings directory, and then lists the subfolders that are subordinate to the subfolder, and dynamically displays the subfolders that belong to it when you change a subfolder of the first level.
Note: Javascript is a string method to determine the cascading object, which is the first-level subfolder name.
and displays the contents of the Level two list box when the page is loaded with a target association selected by the first-level subfolder.
Shawl.qiu
2006-7-28
LineNum
<% @LANGUAGE = "VBSCRIPT"%>
<% Option Explicit
Dim path:path= "Include/system/themes/"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Lists the first-level subfolders in a folder, plus the <option></option>
' Call sgetsubfoldernameatchopt ("Include/managemain/language", Sitefgstyle)
Private Sub Sgetsubfoldernameatchopt (ByRef path,check)
Dim fso, Gfolder, folder, I, fldnm
Set Fso=server. CreateObject ("Scripting.FileSystemObject")
Set Gfolder=fso.getfolder (server. MapPath (PATH))
For each folder in Gfolder.subfolders
Fldnm=folder.name
If Check=folder.name then Response.Write "<option selected=" "Selected" "Value=" "" &_
fldnm& "" ">" Else Response.Write "<option value=" "&fldNm&" ">"
Response.Write FLDNM
Response.Write "</option>"
Next
Set gfolder=nothing
Set fso=nothing
End Sub%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>untitled document</title>
<script>
var subcat;subcat = new Array (); To define an array of child classes to display
<% Dim fso, Gfolder, varcnt, SPFLD, SBFLD
Set Fso=server. CreateObject ("Scripting.FileSystemObject")
Set Gfolder=fso.getfolder (server. MapPath (PATH))
Varcnt=0
For each spfld in Gfolder.subfolders
For each sbfld in spfld.subfolders%>
Subcat[<%response.write Varcnt%>] = new Array ("<%response.write trim (sbfld.name)%>", "<% Response.Write Trim (spfld.name)%> ");
<% varcnt=varcnt+1
Next
Next
Set gfolder=nothing
Set Fso=nothing%>
Varcnt=<%response.write varcnt%>
function Fchangeloct (pathvalue) {
document.all.sbFld.length = 0;
var pathvalue=pathvalue,i
For (I=0;i < varcnt; i++) {
if (subcat[i][1] = = Pathvalue) {
Document.all.sbfld.options[document.all.sbfld.length] = new Option (subcat[i][0], subcat[i][0]);
}
}
}
</script>
<body >
<form action= "" method= "Post" name= "formt" id= "FORMT" >
<select name= "SPFLD" >
<% Call sgetsubfoldernameatchopt (path, "Schinese")%>
</select><br/>
<select name= "SBFLD" ></select>
</form>
</body>