...

View Full Version : Resolved Assistance with multiple {counter}'s in Smarty...



Daniellez
08-07-2009, 02:57 AM
The only problem with this is that it skips a number (from 1 to 3). Is that fixable?

{foreach item=item key=key from=$data}
{counter var="$label+1" assign="label"}
{counter var="$id+1" assign="id"}
<label for="checkbox{$label++}"></label><input id="checkbox{$id++}" type="checkbox" name="txtcheck[]" value="{$item.id}" class="crirHiddenJS" /><br />

...
{/foreach}

* The code in red is what I've added.

Daniellez
08-07-2009, 04:27 AM
Disregard. It's now working with the following:

{foreach item=item key=key from=$data}
{math equation="$label+1" assign="label"}
{math equation="$id+1" assign="id"}
<label for="checkbox{$label++}"></label><input id="checkbox{$id++}" type="checkbox" name="txtcheck[]" value="{$item.id}" class="crirHiddenJS" /><br />

...
{/foreach}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum