Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > ASP and ASP.NET
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 05-22-2009, 07:16 AM
  #1
Bobba Buoy
Super Deity (Level 18)
 
Bobba Buoy's Avatar
 
Join Date: Apr 2003
Posts: 1,053
iTrader: (0)
Bobba Buoy is on a distinguished road
Select Options Duplicates Issue

Can someone look at this and tell me why I am getting multiple values for each k in my select dropdown?

Thanks~

Code:
<%For j = 0 To UBound(AccntItems, 2) - 1%>
	<tr>
		<td style="width:10px;">&nbsp;</td>
		<td style="white-space:nowrap;"><%=AccntItems(1, j)%></td>
		<td style="text-align:right;">$<%=AccntItems(2, j)%></td>
		<td>
			<select name="qty_<%=AccntItems(0, j)%>" id="qty_<%=AccntItems(0, j)%>">
				<%For k = 0 To 25%>
					<%If UBound(ShopCart, 2) > 0 Then%>
						<%For m = 0 To UBound(ShopCart, 2) - 1%>
							<%If CLng(ShopCart(0, m)) = CLng(AccntItems(0, j)) Then%>
								<%If CInt(ShopCart(2, m)) = CInt(k) Then%>
									<option value="<%=k%>" selected><%=k%></option>
								<%Else%>
									<option value="<%=k%>"><%=k%></option>
								<%End If%>
							<%Else%>
								<option value="<%=k%>"><%=k%></option>
							<%End If%>
						<%Next%>
					<%Else%>
						<option value="<%=k%>"><%=k%></option>
					<%End If%>
				<%Next%>
			</select>
		</td>
	</tr>
<%Next%>
__________________
Bobba Buoy
Just trying to make sense of it all ...

Last edited by Bobba Buoy : 05-22-2009 at 07:19 AM.
Bobba Buoy is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 05-26-2009, 05:50 PM
  #2
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,832
iTrader: (0)
afterburn will become famous soon enough
the code looks right but your account loop on the out side may contain multiple values which has multiple shopcart values may match.
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 05-26-2009, 08:34 PM
  #3
Bobba Buoy
Super Deity (Level 18)
 
Bobba Buoy's Avatar
 
Join Date: Apr 2003
Posts: 1,053
iTrader: (0)
Bobba Buoy is on a distinguished road
What happens is every time I add an item to the array it creates duplicates in the dropdown. ie: If there are two items in the array it shows two of everything in the select. If there are three things in the array it shows three of everything, etc.
__________________
Bobba Buoy
Just trying to make sense of it all ...
Bobba Buoy is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 05-27-2009, 09:07 AM
  #4
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,832
iTrader: (0)
afterburn will become famous soon enough
Yeah yeah because the way you are doing your outter most loop

Comments on this post
Bobba Buoy agrees:
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 05-28-2009, 06:28 AM
  #5
Bobba Buoy
Super Deity (Level 18)
 
Bobba Buoy's Avatar
 
Join Date: Apr 2003
Posts: 1,053
iTrader: (0)
Bobba Buoy is on a distinguished road
Oh, sure, thanks!!
__________________
Bobba Buoy
Just trying to make sense of it all ...
Bobba Buoy is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 06:20 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.