Smarty loops and check boxes
| From: | Graeme Merrall | Date: | Thu, 14 Aug 2003 07:48:03 +0000 |
| Subject: | Smarty loops and check boxes | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7181@lists.php.net to get a copy of this message | ||
Hi all.
I've got a Smarty page that loops through an array to display a list of
items which have a check box next to them. The idea is tha a user would
select the items they want to remove and hot submit and they're gone.
<form {$form.attributes}>
{foreach from=$watches item=watch}
{$watch.name} <!-- something goes here :) -->
{/foreach}
</form>
This would get rendered as something like
<form>
One <checkbox name="remove[]" value="1">
Two <checkbox name="remove[]" value="2">
Three <checkbox name="remove[]" value="3">
</form>
I'm not sure how I can create the checkbox in Quickform yet build it into
the loop in Smarty. Any help gratefully received.
Cheers,
Graeme