Sunday, February 26, 2012

Re: Map checkboxes to bitmask

seems like exactly the thing I did the last couple of days:
http://www.dereuromark.de/2012/02/26/bitmasked-using-bitmasks-in-cakephp/
although I used real bitmasks (integer)^^

for the view you should then use a "multiple checkbox" form field

On 26 Feb., 13:29, Boyan Penev <boyan.m.pe...@googlemail.com> wrote:
> Hello,
>
> I would like to accomplish the following: out of 2 checkboxes, if only the
> first one is clicked, the value would be 10, if only the second one- 01, if
> both - 11. I tried giving the checkboxes the same name(array) attribute and
> different values, like:
> $this->Form->input('example', array('type' => 'checkbox', 'name' =>
> 'checked[]', 'value' => 1)
> and i get an indexed array over which i need to iterate in the controller.
> Does anyone have an idea, how could i map the values directly in the view,
> in order for the controller to receive the final result?
>
> Thanks,
>
> Boyan

--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate