I used the same example you did and made the same mistake. The 2nd argument
to $ajax->form is the model, not the form method. Instead of 'post', you
need your model name (author?) there.
Also, I don't think you need $ajax->submit. $form->end('Add') does the right
thing.
Your controller looks fine. I didn't initially understand what the 2nd arg
to $this->render('view','ajax') did, but it's easy to find in the code. The
2nd arg is the layout, so instead of default.ctp, which presumably has your
page frame and navigation, it uses ajax.ctp, which has exactly nothing
around your view.
Glad I could help.
/alastair/
hugocaracol wrote:
>
> ...
>
> $ajax->form('/authors/add','post',array('url' => '/authors/add',
> 'update'=>'DivAddAuthor'));
> $form->input('name');
> $ajax->submit('Add', array('url' => '/authors/add',
> 'update'=>'DivAddAuthor'));
> $form->end();
>
> ...
>
>
--
View this message in context:
http://www.nabble.com/AJAX-form-submission-tp23113847p23119194.html
Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---