One thing that you can easily use to achieve multi row editing: if you
disable all correspondent text fields with javascript (read prototype JS)
when the checkbox is unchecked, then those fields WON'T be posted to the
action controller. Therefore your controller, when dealing with posted
$data, won't even have to check which checkboxes where checked or not.
That is, let's assume that we have checkboxes linked to fields:
checkbox_1 => textfield_1_1, textfield_1_2, textarea_1_1
checkbox_2 => textfield_2_1, textfield_2_2, textarea_2_1
Let's assume that you've set the appropriate javascript to enable/disable
linked fields when checkbox is checked/unchecked.
Then if checkbox_1 is unchecked but checkbox_2 isn't (and consequently
fields textfield_2_1, textfield_2_2, and textarea_2_1 are disabled) then
$data will only contain values for textfield_1_1, textfield_1_2, and
textarea_1_1.
-MI
---------------------------------------------------------------------------
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de [EMAIL PROTECTED]
Enviado el: Martes, 02 de Enero de 2007 09:38 p.m.
Para: Cake PHP
Asunto: Re: How can I modify fields on different rows with one form.
Sorry, simacole, I'm at (and very probably beyond) the limit of my
knowledge of Cake. I'm hoping some others will chime in and show how my
generic php concepts require far too much work. I know (because I've
done it) that it's possible to accomplish multi-row editing (outside
Cake, that is) by using the good old $_POST[] array, but I'm at a loss
about the Cakey nuts and bolts of doing it in a way that takes
advantage of what the framework has to offer.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---