2 loop question
i have following info i'm using in 2 loops:
<cfset colors=#valuelist(scooter.prodcolorcode,",")#>
<cfset colorlist=#valuelist(scooter.prodcolor,",")#>
and actual loop:
<cfloop list="#colors#" index="i">
<cfloop list="#colorlist#" index="c">
<img src="images/prod_colors/#i#.gif" alt="#c#" title="#c#">
</cfloop>
</cfloop>
not working quite way i'd like. 1 image, color
code displaying image, , matching 'color' displayed in
alt , title area. each image displayed number of
times of inner loop.
anyone loops give me solution this?
thanks!
<cfset colors=#valuelist(scooter.prodcolorcode,",")#>
<cfset colorlist=#valuelist(scooter.prodcolor,",")#>
and actual loop:
<cfloop list="#colors#" index="i">
<cfloop list="#colorlist#" index="c">
<img src="images/prod_colors/#i#.gif" alt="#c#" title="#c#">
</cfloop>
</cfloop>
not working quite way i'd like. 1 image, color
code displaying image, , matching 'color' displayed in
alt , title area. each image displayed number of
times of inner loop.
anyone loops give me solution this?
thanks!
quote:
originally posted by: newsgroup user
i have following info i'm using in 2 loops:
<cfset colors=#valuelist(scooter.prodcolorcode,",")#>
<cfset colorlist=#valuelist(scooter.prodcolor,",")#>
and actual loop:
<cfloop list="#colors#" index="i">
<cfloop list="#colorlist#" index="c">
<img src="images/prod_colors/#i#.gif" alt="#c#" title="#c#">
</cfloop>
</cfloop>
not working quite way i'd like. 1 image, color
code displaying image, , matching 'color' displayed in
alt , title area. each image displayed number of
times of inner loop.
anyone loops give me solution this?
you don't want nested loops.
assuming 2 lists have same number of elements, loop through 1 of them , use list functions corresponding element other one.
More discussions in ColdFusion
adobe
Comments
Post a Comment