Please try this
echo $this->Form->checkbox('fieldname',array('checked'=>true));
I use this in many project all work fine.
Thanks
Timir Maji
On Thu, Apr 14, 2011 at 2:37 PM, Jens Dittrich <[email protected]> wrote:
> Have you read the book about using the Helper?
> http://book.cakephp.org/view/1383/Form
> No offense, but I would suggest you start reading there. There seems
> to be quite a misunderstanding in usage of CakePHP Helpers.
> http://book.cakephp.org/view/1528/Blog
>
> regards,
> Jens
>
> On 14 Apr., 10:48, "[email protected]" <[email protected]> wrote:
> > Hi guys,
> > I have a checkbox field which suppose to read db... value 0 or 1...
> > checked=1 or not=0 but its not. What am I missing.
> >
> > <?php echo $form->checkbox('User/show_groups') ?>
> > I have tried with 'checked' => 'checked'
> > <?php echo $form->checkbox('User/show_videos', array('checked' =>
> > 'checked')) ?>
> > but still no results.
> >
> > Thanks
> > Chris
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php