473,236 Members | 1,749 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,236 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 1208
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")
  5. if tOrder = "paperback" then
  6. tPrice = 50.75
  7. else
  8. tPrice = 25.00
  9. end if
  11. tTotalCost = tPrice * tQuantity
  13. Response.Write(tTotalCost)
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

by: Mark 123 | last post by:
Hi I have a form with the input fields: ProductName Quantity and output fields: ProductPrice
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"?...
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...
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...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.