ASP VBScript + Javascript display folder in string two cascade

Source: Internet
Author: User
Tags array object include string trim
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%&gt] = 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>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.