473,395 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do collect selected iteam retrival to shopping chart?

Hi!

In my project, I am working on a Buy page. when users select in the check box that item want to display in display in the Shopping cart page. I don't know. Pls give me some idea.

My doubt is, How i count the checkbox selected?

i try like this

for i = 1 to Request.Form("form").count
if Request.Form("rs("itemcode")")(i) ="on" then


pls reply imm. very very impartent

below my Buy_page code:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <%pathdefiner = "../"%>
  3. <!--#include file="../Connection/connector.asp" -->
  4.  
  5. <html>
  6.  
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  9. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  10. <meta name="ProgId" content="FrontPage.Editor.Document">
  11. <title>Home</title>
  12. </head>
  13.  
  14. <body>
  15.  
  16. <table border="1" width="100%">
  17.   <tr>
  18.     <td width="100%"><img border="0" src="emusic_logo.jpg" width="450" height="100"></td>
  19.   </tr>
  20. </table>
  21. <table border="1" width="100%">
  22.   <tr valign="top">
  23.     <td width="100%" colspan="2">
  24.       <table border="1" width="100%">
  25.         <tr>
  26.           <td width="16%" align="center"><a href="User_Offer.asp">Offer</a></td>
  27.           <td width="16%" align="center"><a href="User_Shopping_Cart.asp">Shopping Cart</a></td>
  28.           <td width="17%" align="center"><a href="User_Wishlist.asp">Wishlist</a></td>
  29.           <td width="17%" align="center"><a href="User_Feedback.asp">Feedback</a></td>
  30.           <td width="17%" align="center"><a href="User_Buy.html">Buy</a></td>
  31.           <td width="17%" align="center"><a href="User_Logout.asp">Logout</a></td>
  32.         </tr>
  33.       </table>
  34.     </td>
  35.   </tr>
  36.   <tr valign="top">
  37.     <td width="1%">
  38.             <table border="1" width="48%">
  39.         <tr valign="top">
  40.           <td width="100%"><a href="User_homepage.asp">Home</a></td>
  41.         </tr>
  42.         <tr>
  43.           <td width="100%"><a href="User_Chart_Toppers.asp">Chart Toppers</a></td>
  44.         </tr>
  45.         <tr>
  46.           <td width="100%"><a href="User_Search.asp">Search</a></td>
  47.         </tr>
  48.         <tr>
  49.           <td width="100%"><a href="User_Vote.asp">Vote</a></td>
  50.         </tr>
  51.         <tr>
  52.           <td width="100%"><a href="User_New_Releases.asp">New Releases</a></td>
  53.         </tr>
  54.         <tr>
  55.           <td width="100%"><a href="User_Register.asp">Register</a></td>
  56.         </tr>
  57.         <tr>
  58.           <td width="100%"><a href="User_Login.asp">Login</a></td>
  59.         </tr>
  60.       </table>
  61.     </td>
  62.     <td width="99%" valign="top"> 
  63.     <form method="GET" action="testpage.asp">
  64.   <!--webbot bot="SaveResults"
  65.   U-File="C:\Inetpub\wwwroot\AspDemo\home\_private\form_results.txt"
  66.   S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
  67.   <p align="center"><b><u> Buy Page </b></u></p>
  68. <P><font face="arial" size="2" color="#800000">Dear <% = Response.Write(Session.Contents("uname"))%>,
  69. <br> The item are displayed To move an item to the shopping cart, select the checkbox next to the item and then click the Move to Shopping Cart button.
  70.  
  71.  
  72. <%
  73. dim searchsong
  74.  
  75. searchsong=Request.Form("cmb_song")
  76. %>
  77.  
  78.   <p><font color="#FF0000"><u>Search Result:</u> </font><b><%=searchsong%> Songs</b></p>
  79.   <table border="1">
  80.  
  81. <tr>
  82.       <td>Buy</td>
  83.       <td>Item</td>
  84.       <td>Prices</td>
  85.     </tr>
  86. <% 
  87.  
  88. Session.Contents("searchsong") = searchsong
  89.  
  90. Set rs = Server.CreateObject("ADODB.Recordset")
  91. Set rs.ActiveConnection = my_Conn
  92.  
  93. retrieveSql = "Select * from tbl_Item_Master where Type_song =  '" & Session.Contents("searchsong") & "';"
  94.  
  95. rs.Source = retrieveSql
  96. rs.Open
  97. dim i
  98. //i=1
  99. Do While not rs.EOF %>
  100.  
  101.     <tr>
  102.       <td><input type="checkbox" name="<% = rs("Item_Code") %>"  value="ON"></td>
  103.       <td><% = rs("Title") %></td>
  104.       <td><% = rs("Rate") %></td>
  105.     </tr>
  106. <%
  107. //i=i+1
  108. rs.MoveNext 
  109.  
  110. Loop
  111.     rs.Close
  112.     my_Conn.Close
  113.     set rs=nothing
  114.     set my_Conn=nothing
  115. %>
  116. </table>
  117.  
  118. <p><input type="Submit" value="Move to Shopping Cart" name="Submit">
  119. <input type="Reset" value="Reset" name="Reset"></p>
  120.  
  121.  
  122. </form>
  123.  
  124.     </font>
  125.  
  126. </td>
  127.   </tr>
  128. </table>
  129.  
  130. </body>
  131.  
  132. </html>
  133.  
  134.  
Apr 10 '10 #1
1 1614
jhardman
3,406 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. for each x in request.form
  2.   if request.form(x) = "on" then
Is this what you are looking for?

Jared
Apr 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Prabhakar | last post by:
Friends, I have been migrating ASP applications from IIS4.0/NT4.0 to IIS5.0/W2K. All the applications working perfectly except one. This particular application will make use of asp chart object....
2
by: Erik | last post by:
Does anybody know of a free ASP shopping cart or some free ASP code to help someone get a shopping cart started. Or does anybody have any experience using a ASP shopping cart that is inexpensive...
2
by: Don Grover | last post by:
I am retrieving costs and product id's from a sql db. and need to build a shopping cart around it. How do I store the selected items and qty req so I can move into another catalog and total up as...
1
by: madison | last post by:
Hi, I am trying to start a website using paypals shopping cart function. If i have 10 items and they sell out, how do I make it so the item is then listed as sold out. The next person would not...
1
by: Jia Sun | last post by:
hello , everybody , i need a similar program , just like fancyimport.com if possible, pls contact me ,thank you very much . inchina@gmail.com
2
by: Kelvin | last post by:
Hi All, If I want to using asp paging to display product. I added 2 pcs in page 1, and I added 3pcs in page 2, and I added 5pcs in page 4 and then click add to cart button. How can I keep them...
4
by: svgeorge | last post by:
I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment) -------------------------------------------------------------------------------- How TO COLLECT THE ROWS...
2
by: ndeeley | last post by:
Hello, I've not had a lot of luck getting this to work, despite looking around lots of websites, so here goes... I have a main form frmProjectScheduler. It's a tabbed form and the front page is...
2
by: Stratocaster | last post by:
Hello, and thank you for any help in advance. I need help determining if any commands exist in VB (Excel macro style) that can enable a user to select cells and run a macro which performs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.