#12004/7/6 20:50:53
在第一个页面 勾选 产品(多选), 在第二个页面中显示所选择的产品 (图片) 。
1.在第一个页面传的值为 bh=001,002,003.....008(变量) <产品编号>
2.在第二个页面通过所选值来 显示所对应该的图片。
---------------------------------------------------------- 这 第二个页面请高手帮我改改, 谢谢
<link href="text.css" rel="stylesheet" type="text/css">
<!--#include file="conn.asp"-->
<%
dim staarr,i
myself=request.servervariables("path_info")
Set rs1=Server.CreateObject("ADODB.Recordset")
staarr = split(request.form("ServiceType"),",")
for i = 0 to ubound(staarr)
sqltext="select * from cp where bh = '"&staarr(i)&"' order by id desc"
rs1.open sqltext,conn,3,3
next
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript>
function checkForm()
{
if (document.theform.username.value=="")
{
alert("请填写你的姓名!");
document.theform.username.focus();
return false;
}
if (document.theform.ServiceType.value=="")
{
alert("请填写产品型号!");
document.theform.ServiceType.focus();
return false;
}
if (document.theform.title.value=="")
{
alert("请填写主题!");
document.theform.title.focus();
return false;
}
if (document.theform.company.value=="")
{
alert("请填写你的公司名称!");
document.theform.company.focus();
return false;
}
if (document.theform.tel.value=="")
{
alert("请填写你的联系电话!");
document.theform.tel.focus();
return false;
}
var checkOK = "0123456789()-";
var checkStr = theform.tel.value;
var allValid = true;
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("请重输 \"联系电话\".");
theform.tel.focus();
return (false);
}
if (document.theform.email.value=="")
{
alert("请填写你的E-MAIL地址!");
document.theform.email.focus();
return false;
}
if (document.theform.email.value.indexOf("@") == -1 || document.theform.email.value.indexOf(".") == -1)
{
alert("请输入有效的电子邮件地址!");
return false;
}
if (document.theform.content.value=="")
{
alert("请填写你的留言信息!");
document.theform.content.focus();
return false;
}
}
</script>
<link href="include/COfeedbac.css" rel="stylesheet" type="text/css">
</head>
<body background="/images/bg0.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="600" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#999999">
<form action="SaveOrder.asp" method="post" name="theform" id="theform" onsubmit="return checkForm()">
<tr align="center" bgcolor="#666666">
<td height="25" colspan="2"><strong></strong></td>
</tr>
<tr>
<td width="20%" height="25" align="right" bgcolor="#CCCCCC">主题:</td>
<td width="80%" bgcolor="e6e6e6"> <input name="title" type="text" class="input1" size="30" />
<font color="#FF6600">*</font> </td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#CCCCCC"> </td>
<td width="80%" bgcolor="e6e6e6"><TABLE width="100%" border=0 align="center" cellPadding=0 cellSpacing=1>
<TBODY>
<TR>
<TD width="99%"
height=1> <%
myself=request.servervariables("path_info")
Set rs1=Server.CreateObject("ADODB.Recordset")
sqltext="select * from cp where bh = '"&request.form("ServiceType")&"' order by id desc"
rs1.open sqltext,conn,3,3
%><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<%row_count=1 %>
<tr align="center">
<% Do While Not rs1.EOF%>
<td align="left"> <table width="60" border="0" cellspacing="0" cellpadding="2">
<tr>
<td height="40">
<div align="center">
<table width="60" height="40" border="0" cellpadding="0" cellspacing="1" bgcolor="#ADADAD">
<tr>
<td bgcolor="#FFFFFF"> <div align="center"><a href="showcenter.asp?id=<%=rs1("id")%>"><img src="<%=rs1("pic1")%>" width="60" height="40" border="0"></a></div></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
<%if row_count mod 4 <>0 then%>
<%end if%>
<% if row_count mod 4 =0 then%>
</tr>
<tr>
<%end if%>
<%
rs1.MoveNext
row_count=row_count+1
Loop
rs1.close
%>
</tr>
<tr>
<td></td>
</tr>
</table></TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#CCCCCC">型号:</td>
<td bgcolor="e6e6e6"> <input name="ServiceType" type="text" class="input1" id="ServiceType" value="<%=request.form("ServiceType")%>" size="60" />
<font color="#FF6600">*</font></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#CCCCCC">姓名:</td>
<td bgcolor="e6e6e6"> <input name="username" type="text" class="input1" size="20" />
<font color="#FF6600">*</font></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#CCCCCC">公司:</td>
<td bgcolor="e6e6e6"> <input name="company" type="text" class="input1" size="20" />
<font color="#FF6600">*</font></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#CCCCCC">电话:</td>
<td bgcolor="e6e6e6"> <input name="tel" type="text" class="input1" size="20" />
<font color="#FF6600">*</font></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#CCCCCC">传真:</td>
<td bgcolor="e6e6e6"> <input name="fax" type="text" class="input1" size="20" />
</td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#CCCCCC">邮件:</td>
<td bgcolor="e6e6e6"> <input name="email" type="text" class="input1" size="30" />
<font color="#FF6600">*</font></td>
</tr>
<tr>
<td align="right" bgcolor="#CCCCCC">留言:</td>
<td bgcolor="e6e6e6"> <textarea name="content" cols="50" rows="6" class="input1"></textarea>
<font color="#FF6600">*</font></td>
</tr>
<tr align="center">
<td height="38" colspan="2" bgcolor="#CCCCCC"> <input name="B1" type="submit" class="input1" onClick="return checkForm();" value=" 提 交 " />
<input name="B2" type="reset" class="input1" value=" 重 写 " /> </td>
</tr>
<tr align="center" bgcolor="#666666">
<td width="100%" height="20" colspan="2" valign="bottom"> <p><font color="#FF9900">带*号为必填项目</font></p></td>
</tr>
</form>
</table>
</body>
</html>