Alright. So up until now I have been super happy with Cake vs. Ruby on
Rails. I have found an equivelent, or often better way of doing
things.

But now I'm stuck.

I'm trying to create a form which is for a model that hasMany
WebAddresses. I'm trying to use javascript to give the user the
ability to add additional WebAddresses to the form dynamically. As
well, the user should be able to delete the fields they created on the
form.

I started writing a helper to do this, and it can be seen here along
with the view code that triggers it:

http://pastie.org/217711

The problem I run into is that Cake uses a number to signify the
multiple records (ie. Reskin.1.WebAddress.address). So far I have Cake
populating the page just fine, and I even have the javascript adding
fields no problem.

The problem comes when a user deletes a field. If they delete, say,
the third field block, if there are any errors and the user comes back
to the form, the numbers on the field names no longer match up with
the $this->data array.

Has anyone accomplished this, or does anyone feel like helping me
figure this one out. Once I get this, I think the Cake community will
benefit from having a helper class like this.

Thanks,

Adam Duro

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

Reply via email to