Thursday, September 23, 2010

Re: Checkbox not work fine

Hi,

The column type is correct: tinyint(1)

I assumed that if the field is needed only to type tinyint declare the
label and the field, correct?

<? Php echo $ form-> input ('active', array ('label' => 'Active'))?>

user_group_id is a combo, it works fine.

The only checkbox is the 'active' field

Thanks!

On 23 sep, 14:04, MissYeh <miss...@gmail.com> wrote:
> 2 things:
>
> 1) Is the column type in the table set to boolean or tinyint(1)?
>
> 2) There is no array with the options passed in for your checkbox:
> echo $this->Form->input('field', array('options' => array('option1',
> 'option2')));
>
> If user_group_id is supposed to be the checkbox then the type is
> wrong, which then should be checkbox.
>
> Take a look at this example:http://book.cakephp.org/view/1390/Automagic-Form-Elements#options-mul...
>
> Hope this solves your issue, let us know! :)
>
> Kana
>
> On Sep 23, 12:26 pm, xamako <xam...@gmail.com> wrote:
>
> > Hi!
>
> > I have a problem with a checkbox.
>
> >  I always get value 0.
>
> > My code is this:http://bin.cakephp.org/view/1438225730
>
> > Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: