Forum Moderators: open
An ASP Script Error Has Occured
Number:450
Description: Wrong number of arguments or invalid property assignment
Source: Microsoft VBScript runtime error
Procedure: SubmitOrder
Thanks!
Checkout.asp:
<%
'build the Payment Info cookie
if Request.Cookies("PaymentInfo")("CCType")= "" then
Response.Cookies("PaymentInfo")("CCMonth") =Request("CCMonth")
Response.Cookies("PaymentInfo")("CCYear") =Request("CCYear")
Response.Cookies("PaymentInfo")("CCHolderName") =Request("CCHolderName")
Response.Cookies("PaymentInfo")("CCNumber") =Request("CCNumber")
For Each cookie in Response.Cookies
Response.Cookies(cookie).Expires = #Jan 4, 2010#
Next
end if
Dim gsCartHTML
Dim gsSubTotal
Dim gsTax
Dim gsTotal
call Main()
Sub Main()
If Session("LoggedIn") Then
' If the user is not from VA, clear all sales tax
If UCase(Request.Form("hiddenShipState")) <> "VA" Then
ClearSalesTax Session.SessionID
End If
gsCartHTML = GetCartHTML(Session.SessionID)
End If
End Sub
Function GetCartHTML(SessionID)
On Error Resume Next
Dim outputHTML
Dim objCart
Dim adoRS
Dim WarrantyText
Dim WarrantyPrice
Dim PartPrice
Dim BasePrice
Dim aRetVals
Set objCart = Server.CreateObject("StoreObjects.CStoreOrders")
Set adoRS = objCart.GetCartParts(SessionID, aRetVals)
If Not IsEmpty(aRetVals) Then
ObjErrHandler aRetVals
Set objCart = Nothing
Set adoRS = Nothing
Exit Function
End If
If adoRS.EOF And adoRS.BOF Then
outputHTML = CartEmptyMessage
Else
Do Until adoRS.EOF
If adoRS("warranty") = 1 Then
WarrantyText = "Free 1yr Warranty"
WarrantyPrice = 0
Else
WarrantyText = "Warranty(<font color=""#FF0000"">" & FormatCurrency(adoRS("WarrantyPrice"),2) & "</font>)"
WarrantyPrice = adoRS("WarrantyPrice")
End If
PartPrice = adoRS("baseprice") + WarrantyPrice + adoRS("shipprice")' + adoRS("coreprice")
gsSubTotal = gsSubTotal + PartPrice
gsTax = gsTax + adoRS("Sales_Tax")
outputHTML = outputHTML & "<td valign=""top"" width=""1062""><font face=""Arial"" size=""1"">"
outputHTML = outputHTML & adoRS("year") & " " & adoRS("make") & " " & adoRS("model") & " " & adoRS("part_desc") & "</font></td>"
outputHTML = outputHTML & "<td valign=""top"" width=""57"" align=""right""></td>"
outputHTML = outputHTML & "</tr>"
outputHTML = outputHTML & "<tr>"
outputHTML = outputHTML & "<td valign=""top"" width=""1062"" bgcolor=""#E5E5E5"">"
'outputHTML = outputHTML & "+ Core(<font color=""#FF0000"">" & FormatCurrency(adoRS("coreprice"), 2) & "</font>) + " & WarrantyText & "</font></font></td>"
outputHTML = outputHTML & "<font face=""arial"" size=""1""><font face=""Arial"" size=""1"">Part Price(<font color=""#FF0000"">" & FormatCurrency(adoRS("baseprice"),2) & "</font>) + Shipping(<font color=""#FF0000"">" & FormatCurrency(adoRS("shipprice"), 2) & "</font>)"
outputHTML = outputHTML & "+ " & WarrantyText & "</font></font></td>"
outputHTML = outputHTML & "<td valign=""top"" width=""57"" bgcolor=""#E5E5E5"" align=""right"">"
outputHTML = outputHTML & "<font face=""Arial"" size=""1""><p align=""right""><font color=""#FF0000"">" & FormatCurrency(PartPrice, 2) & "</font></font></font></td>"
outputHTML = outputHTML & "</tr>"
adoRS.MoveNext
Loop
End If
gsTotal = gsSubTotal + gsTax
GetCartHTML = outputHTML
Set objCart = Nothing
Set adoRS = Nothing
If err.number > 0 Then
ShowASPErrMessage err.number,err.description,"GetCartHTML",err.source
End If
End Function
Sub ClearSalesTax(CartID)
On Error Resume Next
Dim objCart
Dim aRetVals
Set objCart = Server.CreateObject("StoreObjects.CStoreOrders")
objCart.ClearSalesTaxFromCart CartID, aRetVals
If Not IsEmpty(aRetVals) Then
ObjErrHandler aRetVals
Set objCart = Nothing
Exit Sub
End If
Set objCart = Nothing
If err.number > 0 Then
ShowASPErrMessage err.number,err.description,"GetCartHTML",err.source
End If
End Sub
Function CartEmptyMessage()
Dim outputHTML
outputHTML = outputHTML & "<td valign=""top"" width=""1062""><font face=""Arial"" size=""2"">"
outputHTML = outputHTML & "<b>Your Cart Is Empty Or Your Session May Have Timmed Out.</b></font></td>"
outputHTML = outputHTML & "<td valign=""top"" width=""57"" align=""right""></td>"
outputHTML = outputHTML & "</tr>"
CartEmptyMessage = outputHTML
End Function
%>
<form method="POST" action="confirmation.asp" name="frmMain">
<input type="hidden" name="hiddenCCNumber" size="25" value="<%=Request.Form("CCNumber")%>"><input type="hidden" name="hiddenCCHolderName" size="25" value="<%=Request.Form("CCHolderName")%>"><input type="hidden" name="hiddenCCValidTo" size="7" value="<%=Request.Form("CCMonth") & "/" & Request.Form("CCYear")%>"><input type="hidden" name="hiddenCCType" size="20" value="<%=Request.Form("CCType")%>"><input type="hidden" name="hiddenShipZip" size="28" value="<%=Request.Form("hiddenShipZip")%>"><input type="hidden" name="hiddenShipState" size="28" value="<%=Request.Form("hiddenShipState")%>"><input type="hidden" name="hiddenShipCity" size="28" value="<%=Request.Form("hiddenShipCity")%>"><input type="hidden" name="hiddenShipAddress2" size="28" value="<%=Request.Form("hiddenShipAddress2")%>"><input type="hidden" name="hiddenShipAddress" size="28" value="<%=Request.Form("hiddenShipAddress")%>"><input type="hidden" name="hiddenContact" size="28" value="<%=Request.Form("hiddenContact")%>"><input type="hidden" name="hiddenEmail" size="28" value="<%=Request.Form("hiddenEmail")%>"><input type="hidden" name="hiddenPhone" size="28" value="<%=Request.Form("hiddenPhone")%>"><input type="hidden" name="hiddenZip" size="28" value="<%=Request.Form("hiddenZip")%>"><input type="hidden" name="hiddenState" size="28" value="<%=Request.Form("hiddenState")%>"><input type="hidden" name="hiddenCity" size="28" value="<%=Request.Form("hiddenCity")%>"><input type="hidden" name="hiddenAddress2" size="28" value="<%=Request.Form("hiddenAddress2")%>"><input type="hidden" name="hiddenAddress" size="28" value="<%=Request.Form("hiddenAddress")%>"><input type="hidden" name="hiddenCompany" size="28" value="<%=Request.Form("hiddenCompany")%>"><input type="hidden" name="hiddenLastName" size="28" value="<%=Request.Form("hiddenLastName")%>"><input type="hidden" name="hiddenFirstName" size="28" value="<%=Request.Form("hiddenFirstName")%>"><input type="hidden" name="hiddenUserID" size="28" value="<%=Request.Form("hiddenUserID")%>">
<table border="1" width="500" cellspacing="0" cellpadding="0" bordercolor="#808080" bordercolorlight="#808080" bordercolordark="#808080">
Confirmation.asp
<%
Dim gbShowErrMsg
Dim gbShowCartEmptyMsg
Call Main()
Sub Main()
Dim SalesTax
'If Session("LoggedIn") Then
SubmitOrder Session.SessionID, Request.Form("hiddenUserID"),Request.Form("hiddenCompany"),Request.Form("hiddenFirstName"), _
Request.Form("hiddenLastName") ,Request.Form("hiddenAddress"),Request.Form("hiddenAddress2"), _
Request.Form("hiddenCity"), Request.Form("hiddenState"), Request.Form("hiddenZip"), Request.Form("hiddenPhone") ,Request.Form("hiddenEmail"), _
Request.Form("hiddenContact"), Request.Form("hiddenShipAddress"),Request.Form("hiddenShipAddress2"),Request.Form("hiddenShipCity"), _
Request.Form("hiddenShipState"), Request.Form("hiddenShipZip"), "credit card", Request.Form("hiddenCCType"), _
Request.Form("hiddenCCValidTo"), Request.Form("hiddenCCHolderName"), Request.Form("hiddenCCNumber"), _
cstr(Mid(Request.Form("CustomerComments"),1, 449)), Session("LogDate")
'End If
End Sub
Sub SubmitOrder(SessionID, UserID, Company, FirstName, LastName, Address, Address2, City, _
State, Zip, Phone, Email, Contact, Ship1, Ship2, ShipCity, ShipState, ShipZip, PayMethod, CCType, _
CCValidTo, CCHolderName, CCNumber, CustomerComments, OrderDate)
On Error Resume Next
Dim objCart
Dim aRetVals
' Make sure all required fields were passed
If Not ValidateFields() Then
gbShowErrMsg = True
Exit Sub
End If
' Make sure at least one part was ordered
If CartIsEmpty(SessionID) Then
gbShowCartEmptyMsg = True
Exit Sub
End If
Set objCart = Server.CreateObject("StoreObjects.CStoreOrders")
objCart.SubmitOrder SessionID, UserID, Company, FirstName, LastName, Address, Address2, City, State, _
Zip, Phone, Email, Contact, Ship1, Ship2, ShipCity, ShipState, ShipZip, PayMethod, _
CCType, CCValidTo, CCHolderName, CCNumber, CustomerComments, OrderDate, aRetVals
Session("LogDate") = Now()
If Not IsEmpty(aRetVals) Then
ObjErrHandler(aRetVals)
gbShowErrMsg = True
End If
Set objCart = Nothing
If err.number > 0 Then
ShowASPErrMessage err.number,err.description,"SubmitOrder",err.source
gbShowErrMsg = True
End If
End Sub
Function ValidateFields()
If Request.Form("hiddenUserID") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenFirstName") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenAddress") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCity") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenState") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenZip") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenPhone") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenContact") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenShipAddress") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenShipCity") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenShipState") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenShipZip") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCCType") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCCValidTo") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCCHolderName") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCCNumber") = "" Then
ValidateFields = False
Exit Function
End If
If Session("LogDate") = "" Then
ValidateFields = False
Exit Function
End If
ValidateFields = True
End Function
Function CartIsEmpty(SessionID)
On Error Resume Next
Dim objCart
Dim aRetVals
Set objCart = Server.CreateObject("StoreObjects.CStoreOrders")
Set adoRS = objCart.GetCartParts(SessionID, aRetVals)
If Not IsEmpty(aRetVals) Then
ObjErrHandler aRetVals
Set objCart = Nothing
Set adoRS = Nothing
Exit Function
End If
If adoRS.EOF And adoRS.BOF Then
CartIsEmpty = True
Else
CartIsEmpty = False
End If
Set objCart = Nothing
Set adoRS = Nothing
If err.number > 0 Then
ShowASPErrMessage err.number,err.description,"GetCartHTML",err.source
End If
End Function
%>
I could not find a <input ... for your CustomerComments element nor could I find the closing of your </form> but maybe you have more code on your page than in this post.
<html>
<head>
<title>Check Out</title>
<link REL="STYLESHEET" TYPE="text/css" HREF="global.css">
</head>
<body leftmargin="0" bgcolor="#FFFFFF">
<table border="0" width="500" cellspacing="1" cellpadding="0">
<tr>
<td width="598"><map name="FPMap0">
<area href="default.asp" shape="rect" coords="162, 0, 189, 25">
<area href="javascript:window.history.back(1);window.history.back(1);window.history.back(1)" shape="rect" coords="240, 0, 266, 26">
<area href="shopping_cart.asp" shape="rect" coords="318, 0, 344, 26"></map><img BORDER="0" src="Images/top_step4.gif" WIDTH="440" HEIGHT="46" usemap="#FPMap0"></td>
</tr>
<tr>
<td width="598" height="10"></td>
</tr>
<tr>
<td width="598"><p align="center"><img src="../images/red_bar.gif" width="434" height="9"></td>
</tr>
</table>
<form method="POST" action="confirmation.asp" name="frmMain">
<input type="hidden" name="hiddenCCNumber" size="25" value="<%=Request.Form("CCNumber")%>"><input type="hidden" name="hiddenCCHolderName" size="25" value="<%=Request.Form("CCHolderName")%>"><input type="hidden" name="hiddenCCValidTo" size="7" value="<%=Request.Form("CCMonth") & "/" & Request.Form("CCYear")%>"><input type="hidden" name="hiddenCCType" size="20" value="<%=Request.Form("CCType")%>"><input type="hidden" name="hiddenShipZip" size="28" value="<%=Request.Form("hiddenShipZip")%>"><input type="hidden" name="hiddenShipState" size="28" value="<%=Request.Form("hiddenShipState")%>"><input type="hidden" name="hiddenShipCity" size="28" value="<%=Request.Form("hiddenShipCity")%>"><input type="hidden" name="hiddenShipAddress2" size="28" value="<%=Request.Form("hiddenShipAddress2")%>"><input type="hidden" name="hiddenShipAddress" size="28" value="<%=Request.Form("hiddenShipAddress")%>"><input type="hidden" name="hiddenContact" size="28" value="<%=Request.Form("hiddenContact")%>"><input type="hidden" name="hiddenEmail" size="28" value="<%=Request.Form("hiddenEmail")%>"><input type="hidden" name="hiddenPhone" size="28" value="<%=Request.Form("hiddenPhone")%>"><input type="hidden" name="hiddenZip" size="28" value="<%=Request.Form("hiddenZip")%>"><input type="hidden" name="hiddenState" size="28" value="<%=Request.Form("hiddenState")%>"><input type="hidden" name="hiddenCity" size="28" value="<%=Request.Form("hiddenCity")%>"><input type="hidden" name="hiddenAddress2" size="28" value="<%=Request.Form("hiddenAddress2")%>"><input type="hidden" name="hiddenAddress" size="28" value="<%=Request.Form("hiddenAddress")%>"><input type="hidden" name="hiddenCompany" size="28" value="<%=Request.Form("hiddenCompany")%>"><input type="hidden" name="hiddenLastName" size="28" value="<%=Request.Form("hiddenLastName")%>"><input type="hidden" name="hiddenFirstName" size="28" value="<%=Request.Form("hiddenFirstName")%>"><input type="hidden" name="hiddenUserID" size="28" value="<%=Request.Form("hiddenUserID")%>">
<table border="1" width="500" cellspacing="0" cellpadding="0" bordercolor="#808080" bordercolorlight="#808080" bordercolordark="#808080">
<tr>
<td width="100%"><table border="0" width="504" cellspacing="1" cellpadding="0">
<tr>
<td bgcolor="#C0C0C0" width="1064"><b><font size="1" face="Arial">Parts</font></b></td>
<td bgcolor="#C0C0C0" width="55"><b><font size="1" face="Arial">Price</font></b></td>
</tr>
<%=gsCartHTML%>
<tr>
<td width="411" align="right"><p align="right"><font face="Arial" size="1"><b>Subtotal:</b></font></td>
<td width="87" align="right"><font color="#FF0000"><font size="1" face="Arial"><%=FormatCurrency(gsSubTotal,2)%></a></font></td>
</tr>
<tr>
<td width="411" align="right"><font face="Arial" size="1"><b>VA Sales Tax:</b></font></td>
<td width="87" align="right"><font color="#FF0000"><font size="1" face="Arial"><%=FormatCurrency(gsTax,2)%></a></font></td>
</tr>
<tr>
<td width="411" align="right"><font face="Arial" size="1"><b>Total:</b></font></td>
<td width="87" align="right"><font color="#FF0000"><font size="1" face="Arial"><%=FormatCurrency(gsTotal,2)%></a></font></td>
</tr>
</table>
<table border="0" width="503" cellspacing="1" cellpadding="0" height="209">
<tr>
<td bgcolor="#C0C0C0" width="1118" colspan="3" height="1"><b><font face="Arial" size="1">Billing
Address</font></b></td>
</tr>
<tr>
<td width="167" height="16" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>First Name</b></font></td>
<td width="167" height="16" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Last Name</b></font></td>
<td width="167" height="16" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Company</b></font></td>
</tr>
<tr>
<td width="167" height="16"><font size="1" face="Arial"><%=Request.Form("hiddenFirstName")%></font></td>
<td width="167" height="16"><font size="1" face="Arial"><%=Request.Form("hiddenLastName")%></font></td>
<td width="167" height="16"><font size="1" face="Arial"><%=Request.Form("hiddenCompany")%></font></td>
</tr>
<tr>
<td width="167" height="16" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Address</b></font></td>
<td width="167" height="16" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Address2</b></font></td>
<td width="167" height="16" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>City</b></font></td>
</tr>
<tr>
<td width="167" height="16"><font size="1" face="Arial"><%=Request.Form("hiddenAddress")%></font></td>
<td width="167" height="16"><font size="1" face="Arial"><%=Request.Form("hiddenAddress2")%></font></td>
<td width="167" height="16"><font size="1" face="Arial"><%=Request.Form("hiddenCity")%></font></td>
</tr>
<tr>
<td width="167" height="16" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>State</b></font></td>
<td width="167" height="16" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Zip</b></font></td>
<td width="167" height="16" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Phone</b></font></td>
</tr>
<tr>
<td width="167" height="16"><font size="1" face="Arial"><%=Request.Form("hiddenState")%></font></td>
<td width="167" height="16"><font size="1" face="Arial"><%=Request.Form("hiddenZip")%></font></td>
<td width="167" height="16"><font size="1" face="Arial"><%=Request.Form("hiddenPhone")%></font></td>
</tr>
<tr>
<td width="501" height="8" bgcolor="#E5E5E5" colspan="3"><font size="1" face="Arial"><b>Email</b></font></td>
</tr>
<tr>
<td width="167" height="8"><font size="1" face="Arial"><%=Request.Form("hiddenEmail")%></font></td>
<td width="167" height="8"></td>
<td width="167" height="8"></td>
</tr>
<tr>
<td bgcolor="#C0C0C0" width="1118" bordercolor="#C0C0C0" colspan="3" height="16"><b><font face="Arial" size="1">Shipping
Address</font></b></td>
</tr>
<tr>
<td width="167" height="6" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Contact</b></font></td>
<td width="167" height="6" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Address</b></font></td>
<td width="167" height="6" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Address2</b></font></td>
</tr>
<tr>
<td width="167" height="5"><font size="1" face="Arial"><%=Request.Form("hiddenContact")%></font></td>
<td width="167" height="5"><font size="1" face="Arial"><%=Request.Form("hiddenShipAddress")%></font></td>
<td width="167" height="5"><font size="1" face="Arial"><%=Request.Form("hiddenShipAddress2")%></font></td>
</tr>
<tr>
<td width="167" height="3" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>City</b></font></td>
<td width="167" height="3" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>State</b></font></td>
<td width="167" height="3" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Zip</b></font></td>
</tr>
<tr>
<td width="167" height="2"><font size="1" face="Arial"><%=Request.Form("hiddenShipCity")%></font></td>
<td width="167" height="2"><font size="1" face="Arial"><%=Request.Form("hiddenShipState")%></font></td>
<td width="167" height="2"><font size="1" face="Arial"><%=Request.Form("hiddenShipZip")%></font></td>
</tr>
</table>
<table border="0" width="503" cellspacing="1" cellpadding="0" height="65">
<tr>
<td bgcolor="#C0C0C0" width="1118" colspan="4" height="16"><b><font face="Arial" size="1">Billing
Information</font></b></td>
</tr>
<tr>
<td width="105" height="18" align="left" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Credit Card</b></font></td>
<td width="86" height="18" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Expiration Date</b></font></td>
<td width="155" height="18" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Card Holder's Name</b></font></td>
<td width="151" height="18" bgcolor="#E5E5E5"><font size="1" face="Arial"><b>Card Number</b></font></td>
</tr>
<tr>
<td width="105" height="1" align="left"><font size="1" face="Arial"><%=Request.Form("CCType")%></font></td>
<td width="86" height="1"><font size="1" face="Arial"><%=Request.Form("CCMonth") & "/" & Request.Form("CCYear")%></font></td>
<td width="155" height="1"><font size="1" face="Arial"><%=Request.Form("CCHolderName")%></font></td>
<td width="151" height="1"><font size="1" face="Arial"><%=Request.Form("CCNumber")%></font></td>
</tr>
<tr>
<td width="1118" height="16" align="right" bgcolor="#C0C0C0" colspan="4">
<p align="left"><b><font face="Arial" size="1">Comments-NOTE More than 220 characters or punctuation can cause an ASP Script ERROR</font></b></td>
</tr>
<tr>
<td width="1118" height="14" align="right" colspan="4">
<p align="left"><font face="Arial" size="1"><textarea rows="2" name="CustomerComments" cols="59"></textarea></font></td>
</tr>
</table>
<table border="0" cellspacing="0" width="504" cellpadding="0" height="27">
<tr>
<td width="502" height="3" bgcolor="#C0C0C0" colspan="3">
</td>
</tr>
<tr>
<td width="72" height="20">
<p align="left"><a HREF="javascript:window.history.back(1);"><img alt BORDER="0" src="images/btn_back.gif" style="CURSOR: hand" WIDTH="48" HEIGHT="15"></a></td>
<td width="292" height="20">
<p align="left"><font size="2" face="Arial"><b>I have read and agree to the Terms Of Sale. Pre-install requirements must be followed for warranty to be valid. Please print terms for requirements on this part.</b></font></td>
<p align="left"><font size="2" face="Arial"><b>LABOR IS NOT COVERED UNDER WARRANTY</b></font></td>
<td width="134" height="20">
<p align="left"><a HREF="javascript:document.frmMain.submit();"><img BORDER="0" src="images/agree.gif" alt="I Agree" class="clsNavButton" WIDTH="58" HEIGHT="16"></a></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<table border="0" width="500" cellspacing="0" cellpadding="0">
<tr>
<td width="498" height="10" colspan="2"></td>
</tr>
<tr>
<td width="498" colspan="2"><p align="center"><img src="images/nav_left.gif" alt WIDTH="36" HEIGHT="26"><a href="shopping_cart.asp"><img src="images/nav_viewcart.gif" alt="View Cart" class="clsNavButton" WIDTH="86" HEIGHT="26" border="0"></a><a href="special_order.asp"><img class="clsNavButton" src="images/nav_specialorder.gif" WIDTH="103" HEIGHT="26" border="0" alt="Special Order"></a><a href="check_out_help.htm"><img class="clsNavButton" src="images/nav_help.gif" WIDTH="86" HEIGHT="26" border="0" alt="Help"></a><a href="sales_terms.asp"><img class="clsNavButton" src="images/nav_terms.gif" WIDTH="86" HEIGHT="26" border="0" alt="Sales Terms"></a><img src="images/nav_right.gif" alt WIDTH="36" HEIGHT="26"></td>
</tr>
</table>
<p align="center"> </p>
</body>
</html>
<%@Language="VBScript"%>
<!--#Include File="ErrHandler.asp"-->
<%
Dim gbShowErrMsg
Dim gbShowCartEmptyMsg
Call Main()
Sub Main()
Dim SalesTax
'If Session("LoggedIn") Then
SubmitOrder Session.SessionID, Request.Form("hiddenUserID"),Request.Form("hiddenCompany"),Request.Form("hiddenFirstName"), _
Request.Form("hiddenLastName") ,Request.Form("hiddenAddress"),Request.Form("hiddenAddress2"), _
Request.Form("hiddenCity"), Request.Form("hiddenState"), Request.Form("hiddenZip"), Request.Form("hiddenPhone") ,Request.Form("hiddenEmail"), _
Request.Form("hiddenContact"), Request.Form("hiddenShipAddress"),Request.Form("hiddenShipAddress2"),Request.Form("hiddenShipCity"), _
Request.Form("hiddenShipState"), Request.Form("hiddenShipZip"), "credit card", Request.Form("hiddenCCType"), _
Request.Form("hiddenCCValidTo"), Request.Form("hiddenCCHolderName"), Request.Form("hiddenCCNumber"), _
cstr(Mid(Request.Form("CustomerComments"),1, 449)), Session("LogDate")
'End If
End Sub
Sub SubmitOrder(SessionID, UserID, Company, FirstName, LastName, Address, Address2, City, _
State, Zip, Phone, Email, Contact, Ship1, Ship2, ShipCity, ShipState, ShipZip, PayMethod, CCType, _
CCValidTo, CCHolderName, CCNumber, CustomerComments, OrderDate)
On Error Resume Next
Dim objCart
Dim aRetVals
' Make sure all required fields were passed
If Not ValidateFields() Then
gbShowErrMsg = True
Exit Sub
End If
' Make sure at least one part was ordered
If CartIsEmpty(SessionID) Then
gbShowCartEmptyMsg = True
Exit Sub
End If
Set objCart = Server.CreateObject("StoreObjects.CStoreOrders")
objCart.SubmitOrder SessionID, UserID, Company, FirstName, LastName, Address, Address2, City, State, _
Zip, Phone, Email, Contact, Ship1, Ship2, ShipCity, ShipState, ShipZip, PayMethod, _
CCType, CCValidTo, CCHolderName, CCNumber, CustomerComments, OrderDate, aRetVals
Session("LogDate") = Now()
If Not IsEmpty(aRetVals) Then
ObjErrHandler(aRetVals)
gbShowErrMsg = True
End If
Set objCart = Nothing
If err.number > 0 Then
ShowASPErrMessage err.number,err.description,"SubmitOrder",err.source
gbShowErrMsg = True
End If
End Sub
Function ValidateFields()
If Request.Form("hiddenUserID") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenFirstName") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenAddress") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCity") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenState") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenZip") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenPhone") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenContact") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenShipAddress") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenShipCity") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenShipState") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenShipZip") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCCType") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCCValidTo") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCCHolderName") = "" Then
ValidateFields = False
Exit Function
End If
If Request.Form("hiddenCCNumber") = "" Then
ValidateFields = False
Exit Function
End If
If Session("LogDate") = "" Then
ValidateFields = False
Exit Function
End If
ValidateFields = True
End Function
Function CartIsEmpty(SessionID)
On Error Resume Next
Dim objCart
Dim aRetVals
Set objCart = Server.CreateObject("StoreObjects.CStoreOrders")
Set adoRS = objCart.GetCartParts(SessionID, aRetVals)
If Not IsEmpty(aRetVals) Then
ObjErrHandler aRetVals
Set objCart = Nothing
Set adoRS = Nothing
Exit Function
End If
If adoRS.EOF And adoRS.BOF Then
CartIsEmpty = True
Else
CartIsEmpty = False
End If
Set objCart = Nothing
Set adoRS = Nothing
If err.number > 0 Then
ShowASPErrMessage err.number,err.description,"GetCartHTML",err.source
End If
End Function
%>
Is 'StoreObjects' purchased component or built by you?
Try to hard code comments with 'testing' and see if this works, first. If does, look into stripping invalid characters before posting, sometimes custom shopping carts like properly formated comments
ie. out=replace(out,"'","''") SQL fix for single quote..etc
also you may see if you may have problem with VbCrLf
out=replace(out,vbcrlf,"<br>")
just guessing..