Figured out the problem, the options array needs the model name
specified
$ajax->form('edit','post',array
('model'=>'User','update'=>'somedivwherecontentshows'));
najnarp
On Dec 21, 4:50 pm, najnarp <[email protected]> wrote:
> I am seeing the following difference in code being generate between
> $ajax->form and $form->create. It seems pretty broken or I may be
> missing something here. Tried with both 1.2 Rc3 and 1.2 Rc4 and same
> behavior.
>
> Using $ajax->form
>
> <div class="input text"><label for="username">User Name</label><input
> name="data[username]" value="r" id="username" type="text"></div>
>
> Problems include
> a) class list for input fields is incorrect
> b) autofill messes up - fields are empty (see c below as well). After
> doing an array_merge($results,$results['User']), the autofill values
> are still wrong. [$results = $this->User->read();]
> c) name is data[fieldname] vs data[model][fieldname], form autofill
> fails due to this
> d) id's are different
>
> Using $form->create
>
> <div class="input text required"><label for="UserUsername">User Name</
> label><input name="data[User][username]" maxlength="255"
> value="robert" id="UserUsername" type="text"></div>
>
> This is correct and things work as expected
>
> Any pointers appreciated!
>
> najnarp
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---