谢谢楼上的,我是菜鸟,不知道怎么用,汗....
我的原提交页:
1.<SCRIPT language=JavaScript type=text/JavaScript>
function ShoppingCart(paintingname)
{
if(document.all[paintingname].SizePrice.value)
{
}
else{
alert("Please select painting size !");
event.returnValue=false;
}
if(document.all[paintingname].Quantity.value)
{
}
else{
alert("Please select Quantity !");
event.returnValue=false;
}
}
</SCRIPT>
2.<form name="abi-001" method="post" action="../../addcart.asp" onsubmit='ShoppingCart("abi-001")'>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><span class="font01">Oil
Painting</span><span class="font02">: abi-001</span></td>
</tr>
<tr>
<td align="center"><INPUT name=Yitem type=hidden id="Yitem"
value=abi-001>
<select name="SizePrice" size="1" id="SizePrice">
<option selected>Please Select Size</option>
<option value="5x7=$9.04">Size:5x7=$9.04</option>
<option value="8x10=$20.64">Size:8x10=$20.64</option>
</select>
<select name="Quantity" size="1" id="select2">
<option selected>Quantity</option>
<option value="1">1</option>
<option value="2">2</option>
</select></td>
</tr>
<tr>
<td align="center"><input name="Submit" type="submit" id="Submit" value="Add to Cart" style="font-family:Arial; font-size: 9pt; color: #d00b0b; font-weight: bold">
</td>
</tr>
</table>
</td></form>
3.addcart.asp
<%
M_IP=Request.Servervariables("REMOTE_HOST")
addtime=Now()
Yitem=request("Yitem")
SizePrice=request("SizePrice")
Quantity=request("Quantity")
set rs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("message.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="insert into cart(M_IP,addtime,Yitem,SizePrice,Quantity) values('"&M_IP&"','"&addtime&"','"&Yitem&"','"&SizePrice&"','"&Quantity&"')"
rs.open sql,conn,1,1
set rs=nothing
set conn=nothing
response.write "<script language=JavaScript>" & chr(13) & "alert('Succeed in putting the shopping cart!');" & "history.back()" & "</script>"
%>
具体要怎么改,才能实现效果啊?再汗一个....