Sunday, March 29, 2009

Re: Cake PHP 1.2 - Need Help For Posting Mulitple Checkboxes

Hi,

Thanks for your support and reply.

i have already done this kind of solution using foreach() loop with
Ids, but as per my seniors and their comments that this is not
standard way that every time we need to do looping mechanism, so i am
looking for any other alternate if possible.

please let me know if you have any other solution or alternate....

Best regards,
Keyur.
---------------------
On Mar 30, 11:10 am, Miles J <mileswjohn...@gmail.com> wrote:
> You are unable to get the input name like data[Model][field][]. The
> best we can get is like so data[Model][field][1].
>
> <?php echo $form->checkbox('Model.field.1'); ?>
>
> To loop it, just increment the number.
>
> <?php echo $form->checkbox('Model.field.2'); ?>
> <?php echo $form->checkbox('Model.field.3'); ?>
>
> And then to go thru the data array
>
> foreach ($this->data['Model']['field'] as $id => $value) {
> if ($value > 0) {
> // checked
>
> }
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: