Add to Shopping Cart with Checkboxes, Qty

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

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)

%>
....

<P>Search Results:</P>
<P>&nbsp;</P>
<P><%=lRecCount%> Products found containing the string <b> <%=sSearch%>
</b>.</P>

<% If lRecCount>0 Then %>

<TABLE cellSpacing=1 cellPadding=1 width="90%" align=left border=1>
<TR>
<TD>Part Number</TD>
<TD>Model</TD>
<TD>Description</TD>
<TD>Price</TD>
<TD>Add</TD>
<TD>Qty</TD>
</TR>

<% For nCount=1 To lRecCount
' rsArray: ProductName, ProductId, ProductGroupCode, ChapterCode
%>

<TR>
<%' we should create a link using product name!%>
<TD><%=rsArray(0, nCount)%> </TD>
<TD><%=rsArray(1, nCount)%></TD>
<TD><%=rsArray(2, nCount)%></TD>
<TD><%=rsArray(3, nCount)%></TD>
<TD><INPUT type=checkbox></TD>
<TD><INPUT style="WIDTH: 40px; HEIGHT: 22px" size=5></TD>
</TR>

Thanks in advance for any help
Axel

.



Relevant Pages

  • Re: Managing 70 checkboxes in financial graphing application
    ... to manage how the checkboxes interact with the data and the graph. ... I have a tab with the data series called "Data". ... This allows the graph to show blanks where data is missing as some series ... My idea is to read the status of all checkboxes into an array. ...
    (microsoft.public.excel.programming)
  • Re: Updating Multiple Rolls Using PHP
    ... I am retrieving records from a table and I ... checkboxes, but my update loop is not working. ... array $_POST. ... Warning: Invalid argument supplied for foreach() in X: ...
    (comp.lang.php)
  • Re: even rows for checkbox forms with no splitting of boxes from values
    ... So I usually roll my own checkboxes. ... In the solution below I wanted to randomize the test script a little ... #this is to create an array with 25-50 strings 2-10 in length ...
    (comp.infosystems.www.authoring.cgi)
  • Re: Grabbing checkbox values
    ... I need to grab only those checkboxes that are checked, so I can then delete those files. ... This array contains data from different ... The 'param' function is part of a perl module that deals with form parsing. ...
    (comp.lang.php)
  • RE: Excel 2003 VBA question
    ... the state of checkboxes until the user clicks "Ok". ... Make a temp array of 6 ... addresses as needed and increment the recipientCount ... If the sendMail function will work with a recipient string like ...
    (microsoft.public.excel.programming)