473,326 Members | 2,173 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,326 software developers and data experts.

ASP Quantity for a form (NOT USING DATABASE)

Hi, I'm pretty new to ASP so please bear with me...

My client would like me to create an order form that allows her customers to order her book and enter the quantity if they want more than one book. She wants it all done on one form on one page, so they click whether they want the audio download or paperback book and then they can type a quantity for each. I've had some issues creating a code that calculates a total and sends all sets of data needed for the merchant (amount, quantity, and version). Everything I've done just doesn't calculate.... Is there a way to do this without having to create a database??

Thanks in advance for any help!!
Sep 19 '07 #1
1 1210
Definitely there is! So I'm guessing on your first web page you've got a radio button (named radOrder for example with values of "paperback" and "audio"), you've got a textbox for the quantity (txtQuantity), and a submit button. All of these contained within a <form> element set to post the results to a the next page (named processOrder.asp for example).

On the processOrder.asp page you'll want to have code like this:
Expand|Select|Wrap|Line Numbers
  1. <%@SCRIPT language="vbscript"%>
  2. tOrder = Request.Form("radOrder")
  3. tQuantity = Request.Form("txtQuantity")
  4.  
  5. if tOrder = "paperback" then
  6. tPrice = 50.75
  7. else
  8. tPrice = 25.00
  9. end if
  10.  
  11. tTotalCost = tPrice * tQuantity
  12.  
  13. Response.Write(tTotalCost)
  14.  
And then do whatever else you want with the total cost. Hopefully my syntax is correct.. I haven't used ASP in a while.

Hope this answers your question!
Sep 19 '07 #2

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

Similar topics

5
by: Mark 123 | last post by:
Hi I have a form with the input fields: ProductName Quantity and output fields: ProductPrice
5
by: HandersonVA | last post by:
should I set to "0" as a default value on a quantity and a price field or set to "null"? if a user enter nothing on the quantity or price field on a web browser, should I treat it as null or "0"?...
9
by: Rob Meade | last post by:
Hi all, Ok - so I've got the array thing going on, and the session thing going on, and up until now its all been ok. I've got my view basket page which is displaying 3 rows (as an example) - I...
2
by: Kanashii | last post by:
First off - I want to thank all who respond / try to help out and even those who took a moment to read over my question. Please be patient as I am -very- new to VB in general and unfortunately...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.