the thing is, that in some models I am also using the saveAll(). I
have 6 saving processes, some save() some saveAll(), and all of them
need to be successful. one failure means, nothing shall be saved....
so this would affect your advice, right? or should i wrap one saveAll
around all six saving procedures?
On 25 Jan., 22:35, jeremyharris <funeralm...@gmail.com> wrote:
> Take a look at the saveAll() method in the Model class, it will handle
> validation and saving and transactions.
>
> As far as ajax feedback, something I've done in the past is pass the ajax
> response to a function that checks the response for validation errors, then
> extract those and output them however I want.
>
> $this->Js->submit('Submit', array('success'=>'onSuccess(event, data,
> textStatus)');
>
> then your js may look something like (assuming jquery)
>
> function onSuccess(event, data, textStatus) {
> $(data).find('div.error'); // etc.
>
> }
>
> If you use the form helper, it will create a div.error for each validation
> error which you can then extract the text from and display however you want.
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment