1个回答
展开全部
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
<form name="form3">
<tr>
<td align="right" height="30">所属大类:</td>
<td class="category">
<%
sql="select * from bigclass order by id"
set rs_bigclass=conn.execute(sql)
if rs_bigclass.eof then
%>
<script language="javascript">
alert("请先添加物料大类!")
window.location.href="../system/bigclass_add.asp"
</script>
<%
response.end
end if
nowbigclass=request("bigclass")
if nowbigclass="" then
nowbigclass=rs_bigclass("id")
end if
%>
<select name="bigclass" onChange="form3.submit()">
<%
do while rs_bigclass.eof=false
%>
<option value="<%=rs_bigclass("id")%>"<%if trim(cstr(rs_bigclass("id")))=nowbigclass then%> selected="selected"<%end if%>><%=rs_bigclass("bigclass")%></option>
<%
rs_bigclass.movenext
loop
%>
</select>
</td>
</tr>
</form>
<form name="form2">
<input type="hidden" name="bigclass" value="<%=nowbigclass%>">
<tr>
<td align="right" height="30">所属小类:</td>
<td class="category">
<%
sql="select * from smallclass where id_bigclass="&nowbigclass&" order by id"
set rs_smallclass=conn.execute(sql)
%>
<select name="smallclass">
<option value="0"></option>
<%
do while rs_smallclass.eof=false
%>
<option value="<%=rs_smallclass("id")%>"<%if trim(cstr(rs_smallclass("id")))=nowsmallclass then%> selected="selected"<%end if%>><%=rs_smallclass("smallclass")%></option>
<%
rs_smallclass.movenext
loop
%>
</select>
</td>
</tr>
</table>
<form name="form3">
<tr>
<td align="right" height="30">所属大类:</td>
<td class="category">
<%
sql="select * from bigclass order by id"
set rs_bigclass=conn.execute(sql)
if rs_bigclass.eof then
%>
<script language="javascript">
alert("请先添加物料大类!")
window.location.href="../system/bigclass_add.asp"
</script>
<%
response.end
end if
nowbigclass=request("bigclass")
if nowbigclass="" then
nowbigclass=rs_bigclass("id")
end if
%>
<select name="bigclass" onChange="form3.submit()">
<%
do while rs_bigclass.eof=false
%>
<option value="<%=rs_bigclass("id")%>"<%if trim(cstr(rs_bigclass("id")))=nowbigclass then%> selected="selected"<%end if%>><%=rs_bigclass("bigclass")%></option>
<%
rs_bigclass.movenext
loop
%>
</select>
</td>
</tr>
</form>
<form name="form2">
<input type="hidden" name="bigclass" value="<%=nowbigclass%>">
<tr>
<td align="right" height="30">所属小类:</td>
<td class="category">
<%
sql="select * from smallclass where id_bigclass="&nowbigclass&" order by id"
set rs_smallclass=conn.execute(sql)
%>
<select name="smallclass">
<option value="0"></option>
<%
do while rs_smallclass.eof=false
%>
<option value="<%=rs_smallclass("id")%>"<%if trim(cstr(rs_smallclass("id")))=nowsmallclass then%> selected="selected"<%end if%>><%=rs_smallclass("smallclass")%></option>
<%
rs_smallclass.movenext
loop
%>
</select>
</td>
</tr>
</table>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询