I am creating a form that has multiple checkboxes.  The basic ideas is
to allow users to select multiple foods that they like.  Each food that
they like is stored in the same table but in a different row.

The foods are categorized.  For instance, once the user checks the
fruits checkbox, an ajax function is called that displays all of the
fruit choices.  The user can then check bannanas, apples etc...

In the controller, I have no way of determining which checkboxes that
they selected, because cake expects you to name the inputs like
'/foods/name'.

In summary
(1) I am currently using this syntax to output each checkbox inside of
a loop :
       echo ($html->checkbox('Food/name/' . $next_indentation_id . '/'
. $id, null,
       array('id'=>$id, 'value'=>$id, 'onchange'=>$ajaxFunction)));
What syntax should I use to display each checkbox?  NOTE: id is unique.

(2) How can I store data into multiple rows of the same database for
the same user in cake (each checked box should result in a new row)?  I
know how to hack this and make it work but I am looking for a graceful
solution.

Thank you


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

Reply via email to