S
sjsean
I've written an asp page in order to handle an array for a simple
shopping cart. What I am trying to accomplish is "deleting" one or
more of the items by basically setting one of the array values to 0 so
that the item won't be considered for further use. I've been
successful in determining which checkboxes are checked but it seems
that my code will set all the items to zero because my conditional
statement isn't working as I expect. Any suggestions are appreciated.
<script type="text/vbscript">
sub refresh()
<% for i = 0 to Session("cartMaxUsed")%>
if document.getElementById(i).checked = True then
<% cartArray(13,i)=0 %>
end if
<%next%>
<%session("cartArray")=cartArray%>
end sub
</script>
shopping cart. What I am trying to accomplish is "deleting" one or
more of the items by basically setting one of the array values to 0 so
that the item won't be considered for further use. I've been
successful in determining which checkboxes are checked but it seems
that my code will set all the items to zero because my conditional
statement isn't working as I expect. Any suggestions are appreciated.
<script type="text/vbscript">
sub refresh()
<% for i = 0 to Session("cartMaxUsed")%>
if document.getElementById(i).checked = True then
<% cartArray(13,i)=0 %>
end if
<%next%>
<%session("cartArray")=cartArray%>
end sub
</script>