stefanb:
I recently had a similar project and ended up doing this in my view
and it seems to be working great so far... obviously you'll need to
change your var names accordingly:

<label>Categories:</label>
<?php foreach($categories as $category): ?>
<div style="width:175px">
<input name="data[Category][Category][]" type="checkbox" <?php foreach
($product_info['Category'] as $selected_category)
{ if($category['Category']['id'] == $selected_category['id']) { echo '
checked '; } } ?> value="<?= $category['Category']['id']; ?>"> - <?=
$category['Category']['title']; ?>
</div>
<?php endforeach ?>







On Oct 7, 2:55 pm, dardosordi <[EMAIL PROTECTED]> wrote:
> Also there are two great articles in the bakery that will help you:
>
> http://bakery.cakephp.org/articles/view/create-multiple-checkboxes-in...
>
> http://bakery.cakephp.org/articles/view/alternative-methods-for-worki...
>
> On Oct 7, 7:00 am, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
>
> > hi Stefan,
>
> > > Is it possible to use checkboxes instead of a multiple select to
> > > represent data in a many-to-many relation?
>
> > I wrote a helper ages ago that does just that, check 
> > outhttp://cakeforge.org/snippet/detail.php?type=snippet&id=190
>
> > hth
>
> > jon
>
> > --
>
> > jon bennett
> > w:http://www.jben.net/
> > iChat (AIM): jbendotnet Skype: jon-bennett


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to