。。。。。
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.SmallClassName.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
function changelocation1(location1id)
{
document.myform.SSmallClassName.length = 1;
var location1id=location1id;
var a;
for (a=0;a < onecount; a++)
{
if (subcat[a][1] == location1id)
{
document.myform.SSmallClassName.options[document.myform.SSmallClassName.length] = new Option(subcat[a][0], subcat[a][2]);
}
}
}
function AddItem(strFileName){
document.myform.IncludePic.checked=true;
document.myform.DefaultPicUrl.value=strFileName;
document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
document.myform.DefaultPicList.selectedIndex+=1;
if(document.myform.UploadFiles.value==''){
document.myform.UploadFiles.value=strFileName;
}
else{
document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
}
}
function CheckForm()
{
if (editor.EditMode.checked==true)
document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
else
document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML;
if (document.myform.Title.value=="")
{
alert("产品名称不能为空!");
document.myform.Title.focus();
return false;
}
if (document.myform.Product_Id.value=="")
{
alert("产品编号不能为空!");
document.myform.Key.focus();
return false;
}
if (document.myform.Content.value=="")
{
alert("产品内容不能为空!");
editor.HtmlEdit.focus();
return false;
}
return true;
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="862" align="center" valign="top"> <b><br>
</b>
<form method="POST" name="myform" onSubmit="return CheckForm();" action="ProductSave.asp?action=add" target="_self">
<table width="620" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr align="center">
<td class="tdbg"> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
<tr>
<td class="back_southidc" height="22" colspan="2" align="right" bgcolor="#A4B6D7"><div align="center"><b>添
加 产 品</b> </div></td>
</tr>
<tr>
<td width="150" height="22" align="right" bgcolor="#A4B6D7">所属类别:</td>
<td bgcolor="#E3E3E3"> <strong>
<%
sql = "select * from BigClass"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "请先添加栏目。"
else
%>
<select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
<option selected value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
<%
dim selclass
selclass=rs("BigClassName")
rs.movenext
do while not rs.eof
%>
<option value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
<%
sql="select * from SmallClass where BigClassName='" & selclass & "'"
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
%>
<select name="SmallClassName" onChange="changelocation1(document.myform.SmallClassName.options[document.myform.SmallClassName.selectedIndex].value)" size="1">
<option value="" selected>不指定小类</option>
<option selected value="<%=trim(rs("SmallClassName"))%>"><%=trim(rs("SmallClassName"))%></option>
<%
dim selclasss
selclasss=rs("SmallClassName")
rs.movenext
do while not rs.eof
%>
<option value="<%=trim(rs("SmallClassName"))%>"><%=trim(rs("SmallClassName"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
<select name="SSmallClassName">
<option value="" selected>不指定小类</option>
<%
sql="select * from SSmallClass where SmallClassName='" & selclasss & "'"
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
%>
<option value="<%=trim(rs("SSmallClassName"))%>"><%=trim(rs("SSmallClassName"))%></option>
<% rs.movenext
do while not rs.eof%>
<option value="<%=trim(rs("SSmallClassName"))%>"><%=trim(rs("SSmallClassName"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
<%
ranNum=int(9*rnd)+10
iddata=month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum
%>
</select>
</strong></td>
</tr>
</table>
<div align="center">
<p>
<input
name="Add" type="submit" id="Add" value=" 添 加 " onClick="document.myform.action='ProductSave.asp?action=add';document.myform.target='_self';">
</p>
</div>
</form></td>
</tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
</body>
</html>