Re: Show validationerrors after a redirect

2009-02-02 Thread brian
I misread your original post. I think what you need to do is call render(), not redirect(). $this->render('chartofaccounts'); On Mon, Feb 2, 2009 at 3:40 PM, Mickiii wrote: > > Thanks Brian, however if I remove the redirect call it displays the > view for the function "add", i.e. the add.ctp (w

Re: Show validationerrors after a redirect

2009-02-02 Thread Miles J
Oops and also remove this: } else { $this->Session->setFlash('Venligt ret fejlene herunder', 'default', array('class'=>'bad')); $this->redirect('chartofaccounts'); } --~--~-~--~~~--

Re: Show validationerrors after a redirect

2009-02-02 Thread Miles J
I see what your saying, do this: if($this->Ledgeraccount->validates()) { if ($this->Ledgeraccount->save($this->data, false)) { $this->redirect('chartofaccounts'); } } --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: Show validationerrors after a redirect

2009-02-02 Thread Mickiii
Miles, is that not what the 'url' option is doing? On Feb 2, 10:54 pm, Miles J wrote: > Just change the url the form is posting to. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this gr

Re: Show validationerrors after a redirect

2009-02-02 Thread Miles J
Just change the url the form is posting to. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to

Re: Show validationerrors after a redirect

2009-02-02 Thread Mickiii
Hang on, I just found this post in the Bakery: http://bakery.cakephp.org/articles/view/validation-in-another-controller Does that still apply? Or has there been done anything built in stuff in the latest version of Cake? On Feb 2, 9:40 pm, Mickiii wrote: > Thanks Brian, however if I remove the

Re: Show validationerrors after a redirect

2009-02-02 Thread Mickiii
Thanks Brian, however if I remove the redirect call it displays the view for the function "add", i.e. the add.ctp (which doesnt exists), but I want it to go back to chartofaccounts where the form is, and then display the errors there. On Feb 2, 9:30 pm, brian wrote: > You don't need to redirect.

Re: Show validationerrors after a redirect

2009-02-02 Thread brian
You don't need to redirect. When you do so, the information stored in $validationErrors is lost because you're making a new request. If you remove the redirect() call, Cake should simply re-display the form. Then if all is working well, FormHelper will take care of printing the errors for you. On