cakephp - I'm not specifying the form action but it (automatically) gives different values in some cases -
i'm creating form using form helper, action of form specified automatically....
this form used editing post..
so, url has structure: mywebsite.com/posts/edit/id , form's action should automatically generated posts/edit/id
but problem is, in cases, open html code , find form's action posts/edit without id causes update fail...
i spent lot of time figure out situation brings wrong action:
- i'm generating fields dynamically (using javascript & ajax) depending on post's category..
- when value of 1 of dynamically generated fields invalid, generated action becomes
posts/edit!!
i need help, cuz don't know why happening !!!
, don't wanna waste more time digging core of cakephp...
so, if of cakephp experts has idea this, plz me !!
thank in advance !
use url parameter, allows explicitly define url form:
echo $form->create('post', array('url' => $html->url(array('action'=>'edit', $id))));
Comments
Post a Comment