I'm actually struggling on this myself.
In my situation, I have a table and on each row there's a check box.
I want to be able to save the state of the check box of a particular
data row whenever the user clicks on it.
The CakePHP manual says that the data can be accessed via $this->data.
However, print_r($this->data) always result in NULL.
print_r($_REQUEST) (or $_POST) will yield in array("checkbox_name" =>
"checkbox_value") only if changing the checkbox from unchecked to
checked, but not the other way.
For simplicity, I had the checkbox_name = ID of the row, and
checkbox_value = the field to set as the flag.
What is the better solution?
Regards,
Iqbal
On Tue, Oct 5, 2010 at 5:41 PM, james livsey <[email protected]> wrote:
> thanks Iqbal!
>
> On Tue, Oct 5, 2010 at 11:40 AM, Iqbal Santyaswardan <[email protected]>
> wrote:
>>
>> If the field is changeable by user, you might have an ObserveField set
>> to that field. See Ajax Helper.
>>
>> Regards
>>
>> On Tue, Oct 5, 2010 at 5:15 PM, james <[email protected]> wrote:
>> > Hi i was wondering how i might set the default value of a checkbox to
>> > the value of the field before it? So if the value of the field before
>> > it is 1 then the checkbox would be checked by default?
>> >
>> > 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 [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
>> >
>>
>> 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 [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
>
> 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 [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
>
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 [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