Re: Using saveAll to insert new fields, update old fields

2010-02-19 Thread WebbedIT
Often you can get so hung up on thinking the problem is with Cake that you forget to thoroughly check your HTML. Been guilty of this myself, glad you found it :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this me

Re: Using saveAll to insert new fields, update old fields

2010-02-18 Thread andy
For future reference for anyone else having the same issue... it turns out that the current HTML tag has a certain scope that needs to be within the same (or within the same,) . I ended up having one tag inside of a ... and then had the ending tag outside of the . Check out the new CakePHP Que

Re: Using saveAll to insert new fields, update old fields

2010-02-18 Thread andy
It turned out that at some point in my Javascript I'm appending the new fields outside of the ... I thought I had checked that before... and I was checking the DOM via Firebug in Firefox. But apparently Firebug (or Firefox,) seems to show and as on the same line... even though I purposely put th

Re: Using saveAll to insert new fields, update old fields

2010-02-17 Thread andy
I wonder if this could be a partial caching issue with the view... - Any fields in the form at first page view will save. - Any fields added via jQuery after first page view are not saved. Does anyone know if CakePHP partially caches a form (view) the first time it is loaded? Check out the new

Re: Using saveAll to insert new fields, update old fields

2010-02-17 Thread andy
No worries about a test case :-) I'll just keep testing different parts of it until something works... it seems like it should work but maybe I am forgetting something. Thanks for your help anyway. Andy On Feb 17, 1:57 am, WebbedIT wrote: > No, you do not need the single quotes within the fi

Re: Using saveAll to insert new fields, update old fields

2010-02-17 Thread WebbedIT
No, you do not need the single quotes within the fields name, that is how I would access the value from the data array. Sorry for any confusion. As you rightly say, your form looks exactly as it should so confusing as to why it refuses to process the dynamic fields? Unfortunately I do not have t

Re: Using saveAll to insert new fields, update old fields

2010-02-16 Thread andy
Here is how the form looks with one existing record (event)... and then with one newly added to the DOM/HTML (before saving... ) using jQuery: This is the first event. This is the first event. I have it just clone an existing form input section and replace the fields with a

Re: Using saveAll to insert new fields, update old fields

2010-02-16 Thread WebbedIT
In your first two representations of your data array there was no second event. As long as the fields you are inserting for the 2nd event follow the data['Event'][1]['fieldname'] format then it should all be ok. I'm confident that you should be able to submit a form that has been built dynamicall

Re: Using saveAll to insert new fields, update old fields

2010-02-15 Thread andy
But I am wanting to use jQuery/Javascript to dynamically add a new form item before saving... I'll keep poking around with it but I am still curious as to if there is a limitation on form-creation with CakePHP... On Feb 15, 12:40 pm, andy wrote: > It appears to work when I manually put in a new

Re: Using saveAll to insert new fields, update old fields

2010-02-15 Thread andy
It appears to work when I manually put in a new input form field into the view... instead of having it being added via jQuery: [data] => Array ( [Event] => Array ( [0] => Array ( [title] =>

Re: Using saveAll to insert new fields, update old fields

2010-02-14 Thread andy
Also, if it helps... here is the HTML output of a newly-added form "event" added to the HTML... before saving with CakePHP: Title Description Weight On Feb 14, 1:00 am, WebbedIT wrote: > Paste a copy of the data array that is getting to your controller > aft

Re: Using saveAll to insert new fields, update old fields

2010-02-14 Thread andy
Sorry, that array actually should look like this (I had previously commented out something...) Array ( [Event] => Array ( [0] => Array ( [title] => First Event [description] => This is the first event.

Re: Using saveAll to insert new fields, update old fields

2010-02-14 Thread andy
Array ( [Event] => Array ( [0] => Array ( [title] => First Event [description] => This is the first event. [weight] => 1 ) ) [Schedule] => Array ( [t

Re: Using saveAll to insert new fields, update old fields

2010-02-14 Thread WebbedIT
Paste a copy of the data array that is getting to your controller after a form submit and someone will advise if it's structured correctly HTH Paul Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because

Using saveAll to insert new fields, update old fields

2010-02-13 Thread andy
Hi all, I've been working on a project where I have the following models: Schedule Event A Schedule has multiple Events. In my edit schedule view, I have a list of events belonging to a particular schedule the user is viewing, like this: Schedule 1 - Event A - Event B - Event C And when I