The use of more ASP cascading menu effect code _ Application techniques

Source: Internet
Author: User

Copy Code code as follows:

<!--#include file= "conn.asp"-->
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "generator" content= "Microsoft FrontPage 4.0" >
<meta name= "ProgId" content= "FrontPage.Editor.Document" >
<title>new Page 1</title>
<body>
<%
Dim rs
Dim sql
Dim count
Set Rs=server.createobject ("Adodb.recordset")
sql = "SELECT * from Shiinfo ORDER by ID ASC"
Rs.Open sql,conn,1,1
%>

<script language= "JavaScript" >
var Onecount;
onecount=0;
subcat = new Array ();
<%
Count = 0
Do as not rs.eof
%>
SUBCAT[&LT;%=COUNT%&GT] = new Array ("<%= Trim (rs (" Shiname "))%>", "<%= Trim (rs (" Shengcode "))%>", "<%= Trim (RS ("id"))%> ");
<%
Count = Count + 1
Rs.movenext
Loop
Rs.close
%>
onecount=<%=count%>;
function Changelocation (LocationID)
{
document.form1.cid.length = 0;
var Locationid=locationid;
var i;
For (I=0;i < onecount; i++)
{
if (subcat[i][1] = = LocationID)
{
Document.form1.cid.options[document.form1.cid.length] = new Option (subcat[i][0], subcat[i][2]);
}
}
}

</SCRIPT>
<script language= "JavaScript" >
<!--
function Checkform ()
{
Document.form1.txtcontent.value=document.form1.doc_html.value;
return True
}
-->
</SCRIPT>
<form name=form1 onsubmit= "check ()" >
Province <%
sql = "SELECT * FROM Shenginfo"
Rs.Open sql,conn,1,1
If rs.eof and Rs.bof then
Response.Write "Please add the province first. "
Response.End
Else
%>
<select name= "Sid" Onchange= "Changelocation (Document.form1.sid.options[document.form1.sid.selectedindex). Value) "><%
Do as not rs.eof
%><option selected Value= "<%=trim (RS (" id ")%>" ><%=trim (RS ("Shengname"))%></option>
<%
Rs.movenext
Loop
End If
Rs.close
%>
</Select>
City: <select name= "CID" >
<option selected value= "" >== Please select City ==</option>
</Select>
</form>
</body>

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.