S
sean
HI There,
I am trying to total the value of some form fields I am referecing the form
field with an inner loop, I am having a little trouble because the amount of
fields returned is always different, how can I roll-up the total of the form
fields (request.form("subtotal_"& i)) to get one final figure?
Sean - Thanks in advance for your answer
for i = 1 to Request.Form.Count
if request.form("quantity_"& i) <> "" AND request.form("quantity_"& i) <>
"0" then
!-- inner loop
dim j
dim thetotalof
for j = 1 to request.form("subtotal_"& i).count
thetotalof = request.form("subtotal_"& i)
response.Write thetotalof
next
!-- finish inner loop
thecounter = thecounter + 1
response.Write "<tr><td>" & trim(stripQuotes(request.form("productid_"&
i))) & "<input type=hidden name=productid_" &
thecounter & " value='" & trim(stripQuotes(request.form("productid_"& i))) &
"'></td><td>" &
trim(stripQuotes(request.form("quantity_"& i))) & "<input type='hidden'
name=quantity_" & thecounter & " value='" &
trim(stripQuotes(request.form("quantity_"& i))) & "'></td><td>" &
Application ("defaultcurrency") & " " &
FormatNumberVal(trim(stripQuotes(request.form("subtotal_"& i)))) & "<input
type='hidden' name=subtotal_" & thecounter & "
value='" & trim(stripQuotes(request.form("subtotal_"& i))) & "'></td></tr>"
end if
next
I am trying to total the value of some form fields I am referecing the form
field with an inner loop, I am having a little trouble because the amount of
fields returned is always different, how can I roll-up the total of the form
fields (request.form("subtotal_"& i)) to get one final figure?
Sean - Thanks in advance for your answer
for i = 1 to Request.Form.Count
if request.form("quantity_"& i) <> "" AND request.form("quantity_"& i) <>
"0" then
!-- inner loop
dim j
dim thetotalof
for j = 1 to request.form("subtotal_"& i).count
thetotalof = request.form("subtotal_"& i)
response.Write thetotalof
next
!-- finish inner loop
thecounter = thecounter + 1
response.Write "<tr><td>" & trim(stripQuotes(request.form("productid_"&
i))) & "<input type=hidden name=productid_" &
thecounter & " value='" & trim(stripQuotes(request.form("productid_"& i))) &
"'></td><td>" &
trim(stripQuotes(request.form("quantity_"& i))) & "<input type='hidden'
name=quantity_" & thecounter & " value='" &
trim(stripQuotes(request.form("quantity_"& i))) & "'></td><td>" &
Application ("defaultcurrency") & " " &
FormatNumberVal(trim(stripQuotes(request.form("subtotal_"& i)))) & "<input
type='hidden' name=subtotal_" & thecounter & "
value='" & trim(stripQuotes(request.form("subtotal_"& i))) & "'></td></tr>"
end if
next