Morning Mutabor,

I did a similar thing with Config values. I printed all of my Config
values on a single page and allowed the user to edit them at one time.
When creating the form I employed non-standard CakePHP form input
naming conventions and then interpreted these at the controller level.

e.g.
<input name="data[0][name]" type="...
<input name="data[0][size]" type="...

<input name="data[1][name]" type="...
<input name="data[1][size]" type="...
etc

Then you can use a `for` loop to cycle through your form data create
the correctly formatted data array based on your form data and use:

foreach ($this->data as $data) {
    $this->Room->save($data);
}

A very simplistic explanation but do you understand what I mean?

On 22/08/06, mutabor <[EMAIL PROTECTED]> wrote:
>
> Hello. I have a model called 'Room'. I need to let user submit as many
> rooms at once as he wants by placing javascript 'Add room' button.
> Each time user press this button it pastes one more set of fields to
> let user enter another room information. And in the end there is submit
> button which submits all rooms at once.
>
> This way I have some sets of fields with equal names in my view and
> Cake's controller  eats only the last one's data :(
> Please, tell me what is the best way to handle this situation with
> Cake? I have looked though groups but wasn't so lucky to find any
> information.
>
> Thank you.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to