Hey cricket thanks a lot..... i fixed this issue with your help.

You are the best :)
Now it works.... i put the hidden field

echo $form->hidden('Post.id');

when i edit a post now it updates and it doens't create a new post.

i wish you a nice weekend!!!
and thanks a lot

On 12 Mrz., 18:29, cricket <[email protected]> wrote:
> On Mar 12, 12:09 pm, pzero <[email protected]> wrote:
>
> > Hallo cricket,
>
> > Thanks a lot, the validation rules works.
> > But i don't had understood where i have to include a hidden form
> > input... Sorry im a newbie.
>
> That's ok. We all start from somewhere. I'm still confused about a lot
> of Cake things.
>
> You put the hidden field in the view. Just after your $form-
>
> >create(...) add this:
>
> echo $form->hidden('Post.id');
>
> What happens is that $this->data = $this->Post->read(null, $id) will
> include the id in the result. FormHelper should then find the id in
> $data inside the view.
>
> If it still doesn't seem to be working, set debug to 2 and try this:
>
> if (!empty($this->data)) {
>     die(debug($this->data));
>
> That is, right before the call to save(). Make sure that the data
> array contains an id. You can also view source when you first load the
> form and ensure that the hidden field is there and that the value is
> correct.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to