This is a discussion on "subtotals and totals" within the Classic ASP section. This forum, and the thread "subtotals and totals are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
subtotals and totals
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
subtotals and totals
Hi:
I have the following variables which I would like to get a sub total for. How do I create a variable for subtotal and store the result in the sub total. SystemAccessFee+ActivationFee+NineOneOneEmergencyF ee+<%=(sGST_HSTRate/100)*7%>+<%=(sPSTRate/100)*7%> thanks, aspkid123 |
|
|
|
#2
|
||||
|
||||
|
Re: subtotals and totals
just use this:-
<% Subtotal = (sGST_HSTRate/100)*7%>+<%=(sPSTRate/100)*7 %>
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#3
|
|||
|
|||
|
Re: subtotals and totals
Thanks for your quick reply.
Another question I have. I have a drop down menu with both id and name tags in the html. I would like to grab the quantity (which are numbers) in the list and display the result on to the next page. Ideally I would like to store the quantity selected in a variable. There is more than one item on the page with multiple drop down menus. |
|
#4
|
||||
|
||||
|
Re: subtotals and totals
use:-
<% quantity = Request.form("quantity") %> obviously change that to the name values and repeat for the others. This really is very very very basic ASP and should be the first thing you learn... I would definitly recommend grabbing a good book.
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#5
|
|||
|
|||
|
Re: subtotals and totals
Thanks again for your help.
On the next page I use the below to retrieve the result? Do I have to define any variables on the results page? <% phoneqty = Request.form("phoneqty") %> Below is an example of the drop down menu on the selection page: <select size="1" id="phoneqty" name="phoneqty"> <option value="phone1">1</option> <option value="phone2">1</option> </select> |
|
#6
|
||||
|
||||
|
Re: subtotals and totals
This:-
<% phoneqty = Request.form("phoneqty") %> That IS for the results page
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#7
|
|||
|
|||
|
Re: subtotals and totals
the items in the drop down menu are randomally generated by a variable.
i tried this code: <% phoneQty<%=item%> = Request.form("phoneQty<%=item%>") %> But it gave me an error page could not be displayed. Is there something wrong in the syntax. <tr> <td colspan=2 nowrap id="phoneSec<%=item%>" name="phoneSec<%=item%>"> <font class="smallBody">Select Quantity:</font> <select name="phoneQty<%=item%>"> <% for i=0 to AllowedPhones%> <option value="<%=i%>" <%if phoneQty(item)=i then%>selected<%end if%>><%=i%></option> <%next%> </select> </td> </tr> |
|
#8
|
||||
|
||||
|
Re: subtotals and totals
<% execute("phoneQty" + item + " = Request.form(""phoneQty" + item +""")") %>
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
Last edited by Rob; Jul 27th, 2006 at 14:19. |
|
#9
|
|||
|
|||
|
Re: subtotals and totals
I would like to take the PhoneQty variable and multiply it with the below variable which contains the price for each phone selected on the previous page. The result should be stored in a variable called PayNow for each phone selection.
$<%=CDbl(phoneSecPrice(i))*0.01%> Could you please debug the below syntax for me: <% PayNow = PhoneQty(item) * $<%=CDbl(phoneSecPrice(i))*0.01%> %> How would I calculate all the PayNow values for a subtotal. Each phone may have a different price associated to it. I would than like to calculate the tax for the pay now subtotal using the below variables. <%=(sGST_HSTRate/100)*7%> <%=(sPSTRate/100)*7%> A variable for the grand total should also be displayed. PayNow Grand Total should have the sub total for all the phones, gst (tax), and pst (tax). PayNowGrandtotal = cint(PayNow) + cint(gst) + cint(pst) Am I close? |
![]() |
| Tags |
| subtotals, totals |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calculated Totals | ekendricks | Databases | 7 | Oct 30th, 2003 14:17 |