Hi there,
Does anyone know a much better way of doing this. I want to only show a “remove all” icon on the first row of the “cart”…
There isn’t a currentrow attribute… and for some reason I can’t access the i variable…
It’s probably really obvious… can someone help.
I’ve bodged it for now with a simple counter called currentrow.
Does anyone have a more eligant solution?
Thanks
<cfoutput>
<cfset currentrow=0>
<cfloop collection="#session.cart#" item="i">
<cfset currentrow = currentrow + 1>
<tr onmouseover="this.style.backgroundColor='##e5e5e5';" onmouseout="this.style.backgroundColor='';">
<td>#session.cart[i][2]#</td>
<td>#session.cart[i][3]#</td>
<td>#session.cart[i][4]#</td>
<td>#session.cart[i][5]#</td>
<cfif currentrow eq 1>
<td align="center"><a href="#cgi.SCRIPT_NAME#?basket=empty" class="linknobold" onClick="return confirm('Are you sure you want to remove ALL of these items?');"><img src="media/icon_delete_all.gif" alt="delete all" title="remove all" width="16" height="16" hspace="2" vspace="2" border="0"></a></td>
<cfelse>
<td><img src="media/clearpixel.gif" width="20" height="1" alt=""></td>
</cfif>
<td align="center" valign="middle"><a href="movie.cfm?mode=view&id=#session.cart[i][1]#"><img src="media/icon_view.gif" alt="view" title="view" width="16" height="16" hspace="2" vspace="2" border="0"></a></td>
<td align="center" valign="middle"><a href="#cgi.SCRIPT_NAME#?basket=remove&barcode=#trim(session.cart[i][5])#" onClick="return confirm('Are you sure you want to remove #trim(session.cart[i][2])#?');"><img src="media/icon_delete.gif" alt="remove" title="remove" width="16" height="16" hspace="2" vspace="2" border="0"></a></td>
</tr>
</cfloop>
</cfoutput>