472,103 Members | 1,073 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,103 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 1169
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

Post your reply

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

Similar topics

5 posts views Thread by Mark 123 | last post: by
reply views Thread by leo001 | last post: by

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.