Add to Shopping Cart with Checkboxes, Qty
am 27.06.2005 14:36:54 von realraven2000Hi,
I have an ASP page that prints out search results from a product
catalog (in a HTML table) - the resultset is returned from a SQL Server
stored procedure. The customer wants to be able to select multiple
items using checkboxes and maybe an Editbox for quantity. There is an
Add to shopping cart button at the bottom of the page.
I have the resultset in an array (used recordset.getRows to populate
it), so I am able to enumerate it. How do I enumerate the checkboxes to
pass on information to the shopping cart? Ideally I would like to read
the values of the checkboxes & editboxes while iterating through the
products array (?). I assume I have to make them unique by naming them
or somehow build an array of checkboxes that runs parallel to my
resultset array.
Here is part of my existing code:
Set rs = CmdSP.Execute( )
rsArray = rs.GetRows
' 1st dimension: number of fields
lRecCount=UBound(rsArray, 2)
%>
....
Search Results:
<%=lRecCount%> Products found containing the string <%=sSearch%>
.
<% If lRecCount>0 Then %>
Part Number | Model | Description | Price | Add | Qty |
<%=rsArray(0, nCount)%> | <%=rsArray(1, nCount)%> | <%=rsArray(2, nCount)%> | <%=rsArray(3, nCount)%> |
Part Number | Model | Description | Price | Add | Qty |
<%=rsArray(0, nCount)%> | <%=rsArray(1, nCount)%> | <%=rsArray(2, nCount)%> | <%=rsArray(3, nCount)%> |