谢谢各位高手
<%
if session("admin")="" then
response.Redirect("login.asp")
end if
%>
<!--#include file="conn.inc"-->
<%
sql="select * from p_class"
set rs=conn.execute(sql)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>经峰网络科技有限公司-系统集成-网络工程-综合布线</title>
<link href="text.css" rel="stylesheet" type="text/css">
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%=rs("c_types")%>","<%=rs("c_name")%>","<%=rs("id")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.ctypes.length = 0;
//window.alert(locationid);
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.ctypes.options[document.form1.ctypes.length] = new Option(subcat[i][0], subcat[i][0]);
//window.alert("aa");
}
}
}
</script>
<script language="javascript">
function checkForm(str){
if(document.all.classid.value=="0"){
alert('请选择一级类别');
return false;
}
if(document.all.title.value==""){
alert('产品名称不能为空');
return false;
}
}
</script>
<style type="text/css">
<!--
body {
background-color: #F3F3F3;
}
.style8 {color: #CCCCCC}
.style9 {color: #aa0000}
-->
</style></head>
<body>
<table width="58%" height="293" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="aa0000">
<tr>
<td align="left" valign="top" bgcolor="#CCCCCC"><table width="100%" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="bb0000">
<tr>
<td><div align="center" class="style8">添加产品信息</div></td>
</tr>
</table>
<form name="form1" method="post" onsubmit="return checkForm();" action="add.asp?cz=8">
<div align="center">
<p align="left">
选择类别:
<select name="classid" id="classid" onChange="changelocation(document.form1.classid.options[document.form1.classid.selectedIndex].value)">
<option value="0" selected>↓==一级类别==↓</option>
<% sql="select * from p_class where l_id=1"
set rs1=conn.Execute (sql) %>
<%dim cj
do while not rs1.EOF
id=rs1("id")
c_name=rs1("c_name")
response.Write("<option value="&id&">"&c_name&"</option>")
%>
<%
rs1.MoveNext
loop
rs1.close
set rs1=nothing
%>
</select>
<select name="ctypes" id="ctypes" >
<option value="0" selected>↓==二级类别==↓</option>
</select>
推荐
<input name="tj" type="checkbox" id="tj" value="1">
<br>
<br>
产品名称:
<input name="title" type="text" id="title">
发布时间:
<input type="text" name="sdate" readonly value="<% response.Write(now()) %>">
</p>
<p align="left">型 号:
<input name="xh" type="text" id="xh">
录 入 人:
<input name="lrr" type="text" readonly value="<%=session("admin")%>">
<br>
<br>
价 格:
<input name="jg" type="text" id="jg">
产品图片:
<input type="text" name="photo" id="photo" >
<input type="button" name="Submit" value="上传图片" onClick="window.open('scpybinbin.asp?formname=form1&editname=photo&uppath=images/upfile&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">
<br>
<br>
产品简介:<br>
<textarea name="jj" cols="60" rows="6" id="jj"></textarea>
<br>
<br>
详细介绍:
<IFRAME ID="eWebEditor1" SRC="et/ewebeditor.asp?id=content1&style=full_v100" FRAMEBORDER="0" SCROLLING="no" WIDTH="630" HEIGHT="450">
</IFRAME>
</p>
<div align="center">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit" value="重置">
</div>
<textarea name="content1" id="content1" style="display:none"></textarea><br>
</p>
</div>
</form></td>
</tr>
</table>
</body>
</html>
不知道你是不是要这个???