On 6/29/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
> Allen, your problem is with HTML understanding instead of cakephp.
>
> Checkboxes need to have their own name, if you redefine another
> checkbox with same name then the value of the last checkbox define
> will be saved.
FWIW, checkboxes do not need to have their own name.
> Also, checkboxes are like 1/0 i.e. checked or not
> checked.
>
> echo $form->checkbox('men') . 'Men';
> echo $form->checkbox('women') . 'Women';
>
> and now when you submit the form, in the controller you should see
>
> $this->data['ModelName']['men']
> $this->data['ModelName']['women']
>
> Hope that helps.
>
> Ketan ;-)
>
>
> Allen Romero wrote:
> > Does anyone know how to display checkboxes in 1.2 then retrieve their
> > values
> >
> > I tried something like
> >
> > echo $form->checkbox('s_sexes',array('value'=>'Men')) . 'Men';
> > echo $form->checkbox('s_sexes',array('value'=>'Women')) . 'Women';
> >
> > but whent he page is submitted, if both are checked, only the second
> > value is submitted to the page.
> >
> > Any examples appreciated.
> >
> > Thx.
> >
> > Allen
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---