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("f orm").count
if Request.Form("r s("itemcode")") (i) ="on" then
pls reply imm. very very impartent
below my Buy_page code:
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("f orm").count
if Request.Form("r s("itemcode")") (i) ="on" then
pls reply imm. very very impartent
below my Buy_page code:
Code:
<%pathdefiner = "../"%>
<!--#include file="../Connection/connector.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Home</title>
</head>
<body>
<table border="1" width="100%">
<tr>
<td width="100%"><img border="0" src="emusic_logo.jpg" width="450" height="100"></td>
</tr>
</table>
<table border="1" width="100%">
<tr valign="top">
<td width="100%" colspan="2">
<table border="1" width="100%">
<tr>
<td width="16%" align="center"><a href="User_Offer.asp">Offer</a></td>
<td width="16%" align="center"><a href="User_Shopping_Cart.asp">Shopping Cart</a></td>
<td width="17%" align="center"><a href="User_Wishlist.asp">Wishlist</a></td>
<td width="17%" align="center"><a href="User_Feedback.asp">Feedback</a></td>
<td width="17%" align="center"><a href="User_Buy.html">Buy</a></td>
<td width="17%" align="center"><a href="User_Logout.asp">Logout</a></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="1%">
<table border="1" width="48%">
<tr valign="top">
<td width="100%"><a href="User_homepage.asp">Home</a></td>
</tr>
<tr>
<td width="100%"><a href="User_Chart_Toppers.asp">Chart Toppers</a></td>
</tr>
<tr>
<td width="100%"><a href="User_Search.asp">Search</a></td>
</tr>
<tr>
<td width="100%"><a href="User_Vote.asp">Vote</a></td>
</tr>
<tr>
<td width="100%"><a href="User_New_Releases.asp">New Releases</a></td>
</tr>
<tr>
<td width="100%"><a href="User_Register.asp">Register</a></td>
</tr>
<tr>
<td width="100%"><a href="User_Login.asp">Login</a></td>
</tr>
</table>
</td>
<td width="99%" valign="top">
<form method="GET" action="testpage.asp">
<!--webbot bot="SaveResults"
U-File="C:\Inetpub\wwwroot\AspDemo\home\_private\form_results.txt"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p align="center"><b><u> Buy Page </b></u></p>
<P><font face="arial" size="2" color="#800000">Dear <% = Response.Write(Session.Contents("uname"))%>,
<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.
<%
dim searchsong
searchsong=Request.Form("cmb_song")
%>
<p><font color="#FF0000"><u>Search Result:</u> </font><b><%=searchsong%> Songs</b></p>
<table border="1">
<tr>
<td>Buy</td>
<td>Item</td>
<td>Prices</td>
</tr>
<%
Session.Contents("searchsong") = searchsong
Set rs = Server.CreateObject("ADODB.Recordset")
Set rs.ActiveConnection = my_Conn
retrieveSql = "Select * from tbl_Item_Master where Type_song = '" & Session.Contents("searchsong") & "';"
rs.Source = retrieveSql
rs.Open
dim i
//i=1
Do While not rs.EOF %>
<tr>
<td><input type="checkbox" name="<% = rs("Item_Code") %>" value="ON"></td>
<td><% = rs("Title") %></td>
<td><% = rs("Rate") %></td>
</tr>
<%
//i=i+1
rs.MoveNext
Loop
rs.Close
my_Conn.Close
set rs=nothing
set my_Conn=nothing
%>
</table>
<p><input type="Submit" value="Move to Shopping Cart" name="Submit">
<input type="Reset" value="Reset" name="Reset"></p>
</form>
</font>
</td>
</tr>
</table>
</body>
</html>
Comment