
asp新手求助搜索二级菜单改为一级菜单或者搜索全部~
<!--#includefile="conn.asp"--><linkhref="style.css"rel="stylesheet"type="text/css"><b...
<!--#include file="conn.asp"--><link href="style.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="60" background="images/s003.gif"><table width="672" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="317" height="15"> </td>
<td width="355"> </td>
</tr>
<tr>
<td height="21"> </td>
<td> <script language="JavaScript" type="text/JavaScript">
<!--
// 提交
function sm()
{
if(chh.prodtype.value=="")
{
alert("请选择产品类别!");
chh.prodtype.focus();
return false;
}
switch (chh.temp.value )
{
case "搜索":
chh.target="_blank";
chh.action="search_product.asp";
break;
}
function dbreset()
{
document.chh.prodtype.value="";
return false;
}
}
//-->
</script> <table width="395" border="0" align="center" cellpadding="0" cellspacing="0">
<form method="POST" onSubmit="return sm()" name=chh>
<input type="hidden" name="account" value="">
<input type="hidden" name="name" >
<input type="hidden" name="temp" value="搜索">
<tr>
<td width="91" height="25" align="right"> </td>
<td width="105"> <input name="prodname" type="text" id="prodname" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: #ffffff" size="12"></td>
<td width="102"> <select name="prodtype" id="prodtype">
<option selected>请选择类别</option>
<%set rs=server.createobject("adodb.recordset")
sql="select * from ProdType order by id DESC"
rs.open sql,conn,3,3
if rs.eof then
else
%>
<%do while not rs.eof%>
<option value="<%=rs("incOrderID")%>" ><%=rs("strTypeName")%></option>
<%rs.movenext
loop
end if
rs.close
%>
</select></td>
<td width="97"><input name="image" type=image src="images/007.GIF" width=45 height=20 border=0 ></td>
</tr>
</form>
</table></td>
</tr>
</table></td>
</tr>
</table>
数据库内容:
ProdType(strTypeName)为二级分类
p_sort(p_sort_name)为一级分类
问题是,我想把本来搜索二级分类改为搜索一级分类或者全部搜索 展开
<body leftmargin="0" topmargin="0">
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="60" background="images/s003.gif"><table width="672" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="317" height="15"> </td>
<td width="355"> </td>
</tr>
<tr>
<td height="21"> </td>
<td> <script language="JavaScript" type="text/JavaScript">
<!--
// 提交
function sm()
{
if(chh.prodtype.value=="")
{
alert("请选择产品类别!");
chh.prodtype.focus();
return false;
}
switch (chh.temp.value )
{
case "搜索":
chh.target="_blank";
chh.action="search_product.asp";
break;
}
function dbreset()
{
document.chh.prodtype.value="";
return false;
}
}
//-->
</script> <table width="395" border="0" align="center" cellpadding="0" cellspacing="0">
<form method="POST" onSubmit="return sm()" name=chh>
<input type="hidden" name="account" value="">
<input type="hidden" name="name" >
<input type="hidden" name="temp" value="搜索">
<tr>
<td width="91" height="25" align="right"> </td>
<td width="105"> <input name="prodname" type="text" id="prodname" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: #ffffff" size="12"></td>
<td width="102"> <select name="prodtype" id="prodtype">
<option selected>请选择类别</option>
<%set rs=server.createobject("adodb.recordset")
sql="select * from ProdType order by id DESC"
rs.open sql,conn,3,3
if rs.eof then
else
%>
<%do while not rs.eof%>
<option value="<%=rs("incOrderID")%>" ><%=rs("strTypeName")%></option>
<%rs.movenext
loop
end if
rs.close
%>
</select></td>
<td width="97"><input name="image" type=image src="images/007.GIF" width=45 height=20 border=0 ></td>
</tr>
</form>
</table></td>
</tr>
</table></td>
</tr>
</table>
数据库内容:
ProdType(strTypeName)为二级分类
p_sort(p_sort_name)为一级分类
问题是,我想把本来搜索二级分类改为搜索一级分类或者全部搜索 展开
1个回答
展开全部
<!--#include file="conn.asp"--><link href="style.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="60" background="images/s003.gif"><table width="672" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="317" height="15"> </td>
<td width="355"> </td>
</tr>
<tr>
<td height="21"> </td>
<td> <script language="JavaScript" type="text/JavaScript">
<!--
// 提交
function sm()
{
switch (chh.temp.value )
{
case "搜索":
chh.target="_blank";
chh.action="search_product.asp";
break;
}
function dbreset()
{
document.chh.prodtype.value="";
return false;
}
}
//-->
</script> <table width="395" border="0" align="center" cellpadding="0" cellspacing="0">
<form method="POST" onSubmit="return sm()" name=chh>
<input type="hidden" name="account" value="">
<input type="hidden" name="name" >
<input type="hidden" name="temp" value="搜索">
<tr>
<td width="91" height="25" align="right"> </td>
<td width="105"> <input name="prodname" type="text" id="prodname" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: #ffffff" size="12"></td>
<td width="102"> <select name="p_sort" id="p_sort">
<option selected>请选择类别</option>
<%set rs=server.createobject("adodb.recordset")
sql="select * from [一级表名] order by id DESC"
rs.open sql,conn,3,3
if rs.eof then
else
%>
<%do while not rs.eof%>
<option value="<%=rs("一级分类ID")%>" ><%=rs("一级分类名称")%></option>
<%rs.movenext
loop
end if
rs.close
%>
</select></td>
<td width="97"><input name="image" type=image src="images/007.GIF" width=45 height=20 border=0 ></td>
</tr>
</form>
</table></td>
</tr>
</table></td>
</tr>
</table>
搜索代码自己改
<body leftmargin="0" topmargin="0">
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="60" background="images/s003.gif"><table width="672" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="317" height="15"> </td>
<td width="355"> </td>
</tr>
<tr>
<td height="21"> </td>
<td> <script language="JavaScript" type="text/JavaScript">
<!--
// 提交
function sm()
{
switch (chh.temp.value )
{
case "搜索":
chh.target="_blank";
chh.action="search_product.asp";
break;
}
function dbreset()
{
document.chh.prodtype.value="";
return false;
}
}
//-->
</script> <table width="395" border="0" align="center" cellpadding="0" cellspacing="0">
<form method="POST" onSubmit="return sm()" name=chh>
<input type="hidden" name="account" value="">
<input type="hidden" name="name" >
<input type="hidden" name="temp" value="搜索">
<tr>
<td width="91" height="25" align="right"> </td>
<td width="105"> <input name="prodname" type="text" id="prodname" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: #ffffff" size="12"></td>
<td width="102"> <select name="p_sort" id="p_sort">
<option selected>请选择类别</option>
<%set rs=server.createobject("adodb.recordset")
sql="select * from [一级表名] order by id DESC"
rs.open sql,conn,3,3
if rs.eof then
else
%>
<%do while not rs.eof%>
<option value="<%=rs("一级分类ID")%>" ><%=rs("一级分类名称")%></option>
<%rs.movenext
loop
end if
rs.close
%>
</select></td>
<td width="97"><input name="image" type=image src="images/007.GIF" width=45 height=20 border=0 ></td>
</tr>
</form>
</table></td>
</tr>
</table></td>
</tr>
</table>
搜索代码自己改
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询