Thanks, got it working. Used some different logic but same idea. It's
not the html output that has me doing this manually, it's because i
need to order the checkboxes according to another model. It's sections
and categories and i want each category to be listed under its
section.

Anyways, thanks a lot for the help.

On Jan 12, 11:13 am, "websta*" <[email protected]>
wrote:
> <?php
>         $checked = (array_key_exists(checkboxName, $this->data[Model]) &&
> !empty($this->data[Model][checkboxName])) ? 'checked' : '';
> ?>
>
> <input type="checkbox" checked="<?php echo $checked;?>"
>
> That what you mean?
>
> Alternatively have a bit of a closer looker at the FormHelper::input method,
> there is quite a bit of flexibility over the html output if that suits your
> needs better.
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
>
> Of kai
> Sent: Tuesday, January 13, 2009 6:06 AM
> To: CakePHP
> Subject: returning checkmarked checkboxes after form is submitted
>
> I'm manually building my checkbox inputs so i can display them in a
> special way. how can i have the marked checkboxes remain marked after
> the form is submitted? This comes as a core feature when using $form-
> >input() but i'm having trouble figuring out how to get this working
> manually. (other than this checkmark problem it's all working good and
> follows the same html as $form->input() and returns a correctly
> formatted $this->data array).
>
> No virus found in this incoming message.
> Checked by AVG -http://www.avg.com
> Version: 8.0.176 / Virus Database: 270.10.6/1888 - Release Date: 1/12/2009
> 7:04 AM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to