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.
{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.