Home | Advertising Info20 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Saturday, May 04, 2024  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - Advanced
 PowerASP Code Help Area : Classic ASP - Advanced
Subject Info: edit shopping cart A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
chanling10
Newbie
Newbie


Joined: January/22/2005
Online Status: Offline
Info: 2
Added: February/05/2005 at 4:39am | IP Logged Quote chanling10

i am facing a problem to edit the member's shopping cart details. more specifically, edit the number of quantity for an item.

the coding will look like as following:

------------------------------------------------------------ ------------------------------

ShoppingCart.asp

------------------------------------------------------------ ------------------------------ 

<table border = "1" >
   <form name="frmCart" action="EditCart.asp" method="post">
  
   <tr bgcolor="#333366">
    <th> <font color="#FFFFFF" > <b> Product </b> </font> </th>
    <th> <font color="#FFFFFF" > <b> Color </b> </font> </th>
    <th> <font color="#FFFFFF" > <b> Price (RM) </b> </font> </th>
    <th width="3"> <font color="#FFFFFF" > <b> Quantity </b> </font> </th>
    <th> <font color="#FFFFFF" > <b> Total (RM) </b> </font> </th>
    <th> <font color="#FFFFFF" > <b> Remove Product </b> </font> </th>
    <th> <font color="#FFFFFF" > <b> Update Product </b> </font> </th>
   </tr>
   <% dim total_order
    total_order  = 0
    while not rs.eof
   %>
  
   <tr bgcolor="#FFFF66">
     <td align="center"><%= rs("itemid") %></td>
    <td align="center"> <%= rs("color") %></td>
    <td align="center"> <%= rs("price") %></td>
    <td width="5" align="center"><input type="textbox" name="txtQ"   value=<%= rs("quantity") %> ></td>
    
    <td align="center">
    <!-- display the total value of the item (price * quantity) -->
    <%= (rs("quantity") * rs("price")) %>
    <!-- increase the total amount of the order by adding the total value of each item -->
    <% total_order  = total_order  + (rs("quantity") * rs("price")) %>
    </td>
    
    <td align="center">
    <!-- edit item image-->
    <a href= "EditCart.asp?cartid= <%= rs("cartid") %>&quantity=txtQ.value" > EDIT </a>
    </td>
    
    <td align="center">
    <!-- delete item image-->
    <a href="DeleteCart.asp">DELETE
    </td>
   </tr>
   
   <% rs.movenext
    wend %>
   
   <tr><td></td>
    <td></td>
    <td></td>
    <td align="right"><b> Total Amount: </b></td>
    
    <!-- displaying the total amount of the order -->
    <td align="center"><b><%= total_order  %><b> </td>    <td></td>
   </tr>
   
   
  </form>
 </table>

------------------------------------------------------------ --------------------------------

the main problem is that i enable to pass the cartid to EditCart.asp, but unable to pass the new Quantity value in txtQ textbox.

can you guys help me to solve it? please...............

Back to Top View chanling10's Profile Search for other info by chanling10
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com