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