📄 regselect.asp
字号:
<!--#include file="Odbc_connection.asp"-->
<%sql = "select * from ypxxtwo order by date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,db,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%count = 0
do while not rs.eof%>
subcat[<%=count%>] = new Array("<%= trim(rs("ypxxtwo"))%>","<%= trim(rs("ypxxone_id"))%>","<%= trim(rs("ypxxtwo_id"))%>");
<%count = count + 1
rs.movenext
loop
rs.close
set rs=nothing%>
onecount=<%=count%>;
function changelocation(ypxxone)
{
document.addform.ypxxtwo_id.length = 0;
var ypxxone_id=ypxxone_id;
var i;
document.addform.ypxxtwo_id.options[0] = new Option('请选择小类','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == ypxxone)
{
document.addform.ypxxtwo_id.options[document.addform.ypxxtwo_id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<%sql = "select * from ypaddtwo order by date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,db,1,1%>
<script language = "JavaScript">
var onecount1;
onecount1=0;
subcat1 = new Array();
<%count = 0
do while not rs.eof%>
subcat1[<%=count%>] = new Array("<%= trim(rs("addtwo"))%>","<%= trim(rs("addone_id"))%>","<%= trim(rs("addtwo_id"))%>");
<%count = count + 1
rs.movenext
loop
rs.close
set rs=nothing%>
onecount1=<%=count%>;
function changelocation1(addone)
{
document.addform.addtwo_id.length = 0;
var addone_id=addone_id;
var i;
document.addform.addtwo_id.options[0] = new Option('请选择市','');
for (i=0;i < onecount1; i++)
{
if (subcat1[i][1] == addone)
{
document.addform.addtwo_id.options[document.addform.addtwo_id.length] = new Option(subcat1[i][0], subcat1[i][2]);
}
}
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>000</title>
</head>
<body topmargin="0">
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height=10></td></tr>
<tr>
<td height=400>
<!--==================-->
<table width="80%" border="0" cellpadding="0" cellspacing="0" align="center">
<form name="addform" method="post" action="reg_save.asp" onSubmit="return checkdata()">
<tr>
<td width="15%" align="center">选择地区</td>
<td width="85%" height="40"><select name="addone_id" onChange="changelocation1(document.addform.addone_id.options[document.addform.addone_id.selectedIndex].value)">
<option value="" selected>请选择省</option>
<%
sql="select * from ypaddone order by date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,db,1,1
while not rs.eof%>
<option value="<%=rs("addone_id")%>"><%=rs("addone")%></option>
<%rs.movenext
wend
rs.Close()
%>
</select>
<select name="addtwo_id">
<option selected value="">请选择市</option>
</select></td>
</tr>
<tr align="center">
<td colspan="2" height="80" valign="top"> </td>
</tr>
</form>
</table>
<!--==================-->
</td>
</tr>
</table>
<script language="javascript">
changelocation(document.addform.ypxxone_id.options[document.addform.ypxxone_id.selectedIndex].value);
</script>
<script language="javascript">
changelocation1(document.addform.addone_id.options[document.addform.addone_id.selectedIndex].value);
</script>
<!--====== bottom ========-->
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor=#ffffff>
<tr><td height=10></td></tr>
<tr><td height=2 bgcolor=#4795EC></td></tr>
<tr>
<td align="center" height=80></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -