Urgent university work, help essential , come on a

Results 1 to 3 of 3

Thread: Urgent university work, help essential , come on a

  1. #1
    Join Date
    Dec 1969

    Default Urgent university work, help essential , come on a

    Hi there,im stuck with the following, could someone please suggest a solution :-<BR><BR>- I want to create a form.<BR>- From this form I want to display items.<BR>- I want the user to be able to select different items that he<BR> or she want to purchase from the form.<BR>- I also want the user to be able to select different quantities<BR> of the items he or she wants to purchase.<BR>- I then want this form page to go to like a checkout page <BR> listing the items, coupled with their specific quantity and <BR> price.Then at the bottom of this page I want the total price.<BR><BR>I ve tried using checkboxes to tick for each order item and a listbox for quantity , but could not link the quantity to the order properly. <BR>Could someone please help me and suggest a good solution to this problem.

  2. #2
    Skippie Guest

    Default RE: Urgent university work, help essential , come

    Using ASP code, number each name of checkboxes, quantites, etc, so the HTML will look something like this:<BR><BR><BR>&#060;INPUT TYPE="TEXT" NAME="QTY_1"&#062;<BR>&#060;INPUT TYPE="CHECKBOX" NAME="CHECK_1"&#062;<BR>&#060;INPUT TYPE="HIDDEN" NAME="SKU_1" VALUE="PRODUCT_A"&#062;<BR><BR>&#060;INPUT TYPE="TEXT" NAME="QTY_2"&#062;<BR>&#060;INPUT TYPE="CHECKBOX" NAME="CHECK_2"&#062;<BR>&#060;INPUT TYPE="HIDDEN" NAME="SKU_2" VALUE="PRODUCT_B"&#062;<BR><BR>&#060;INPUT TYPE="TEXT" NAME="QTY_3"&#062;<BR>&#060;INPUT TYPE="CHECKBOX" NAME="CHECK_3"&#062;<BR>&#060;INPUT TYPE="HIDDEN" NAME="SKU_3" VALUE="PRODUCT_C"&#062;<BR><BR><BR>In the checkout page, you can query each one in a loop like this:<BR><BR>&#060;%<BR>i = 1<BR>total = 0<BR>Do While Request("SKU_" & i) &#060;&#062; ""<BR>check = Request("check_" & i) <BR>If check &#060;&#062; "" Then<BR><BR>sku = Request("SKU_" & i) <BR>qty = Request("QTY_" & i) <BR><BR>SQL = "SELECT PRICE FROM PRODUCT WHERE SKU = &#039" & SKU & "&#039"<BR>price = ** get the price from the SQL query **<BR><BR>total = total + price * qty<BR>End If<BR>i = i + 1<BR>Loop<BR>%&#062;<BR><BR><BR>Notice that I did not include the price as a hidden value.<BR>Why? Because the shopper may be able to change the values <BR>before submitting it. Always make it a habit of looking up the<BR>prices in a database table before processing an order.<BR><BR>-- Skippie <BR><BR><BR><BR><BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Thanx 4 you help Skipp

    Cheers Skippie , have a drink on me son, your assistance much appreciated, Paul , London

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts